PDA

View Full Version : VBA export of cells with variable range



winstonhuxle
07-10-2013, 06:52 AM
Hi,

i am trying to find a way how to define a range of cells to export by some kind of search function.

For example table looks like:


1
...
999
a
1500
...
2300
b


I need to export just cells from 1-999, a is name of another things in column, so it could be used to separate it. The problem is that these number of cells, that need to be transferred are variable.

I hope you could help with this problems.
Thanks in advance :)

snb
07-10-2013, 07:19 AM
Sub M_snb()
With sheets(1).columns(1).find("a",,xlvalues,1)
sheets(2).cells(1).resize(.row-1)= sheets(1).cells(1).resize(.row-1).value
End with
End Sub