VBA Code

Hi !!

I'm new at VBA and need help.
I have a spreadsheet with a summary of all my sales. In this spreadsheet, I have a column "C" with description of the item sold.
I need a code where "If cell C1 = x then copy row to worksheet 2", "If cell C1 = Z then copy row to worksheet 3"...
I want to be able to split my items sold to different worksheets according to their description.

Please I need help URGENT.

Thank you

Help with Excel

Hi !!

I need help again...
I have this order form on my website that my clients fill up and I'm working on export the data from the order form to a main excel spreadsheet containing "name, address, date, item, price, etc" of all my orders received.

On this "Main spreadsheet" I'd like to create a "command" to automatically generates a tax invoice. For example:

John Smith 1 Main St 1/12/2011 red ball $10 generate invoice
Mary Johson 2 Plaza Blvd 5/12/2011 blue ball $10 generate inv

I'd click on "generate invoice" and my tax invoice template would be populated with the data of each client.

Is it possible ?? Does someone can help me and tell me the easiest way to do it??

Thank you.

Nick's picture

hi Kirra this is a bit

hi Kirra

this is a bit involved for the forum..

happy to help via our consultancy

Request a quote

tks

Nick

 

Nick's picture

you can do this without

you can do this without code..

- create a pivot table of your data

- put the row field as the column heading that contains X and Y

- put the amount sold as the "Data" part of the pivot table

then double click on the summary of the data to create a new worksheet with the results you need

More about pivot tables here:

Teach Yourself Excel Lesson 25 - Create A Pivot Table
60. Excel Tips - Pivot Tables for Dummies

 

Pivot Table

Hi Nick,

I'm trying to do using pivot table... easier than VBA
It may work for one part of what I'm trying to do...

Thank you

I'm not sure that is what I want

What I want is from a main spreadsheet copy data automatically to different worksheets using the item sold as criteria to copy the data to the correct worksheet.
For example:
Main spreadsheet -
line 1: 01/12 ball $1
line 2: 02/12 pen $2

Then a VBA code or formula that filters and copy the data automatically:

line 1 into "Worksheet Ball"
line 2 into "Worksheet Pen"

Please help :)

Nick's picture

 ok, if you don't want to do

 ok, if you don't want to do it that way, you need some code..

your best bet is to record a macro.. here's a tip on that:

5. Learn VBA - What does my recorded Macro code actually mean ?