on an Excel spread sheet I have 3 columns of data - in column 1 are invoice numbers, in column 2 are amounts, and in column 3 are descriptions of charges i.e salary,supplies, etc - every invoice can have one or more charges so the invoice number gets repeated and so do the descriptions of charges - I'd like to use VBA and have a user enter an invoice number and all related charges with their descriptions are copied onto another sheet - can anyone point me in the right direction?
Thanks
lctking
i'd do something like this:
create a sub in a module,
create an excel application object,.
ask the invoice number with an input box,
use a DO to search it in the first column (using cells(row,col))
whenever i find the number, place the values into my excel application object.
make my object.visible=true
But you can use UserForms or read the data from your excel sheet, and instead of creating an excel application object you could just create a new workbook in your current excel. And you can use other searching methods. It's faster if you sort your data by invoice.
Good Luck.