how do i get my macro to only work on data thats there?

G

Guest

The macro that i've written is to concatenate cells with data in, the number
of rows can vary depending on the sort of data I'm working with. The macro
works, it concatenates the cells that i've asked it to, however, it
concatenates the empty cells below the data also, resulting in problems when
i try and sort the data after i have run the macro - it brings empty cells up
to the top. Would be very appreciative if anyone knows what value I can
write in the script so that the macro works on data that is there, no matter
how many rows down it is.
 
P

papou

Hello
You may use some code like this:
For i = 1 to Worksheets("Sheet1").range("a65536").end(xlup).row
'your stuff here
Next i

HTH
Cordially
Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top