empty cell in a colomn

K

Khalil Handal

Hi,
I have work sheet for monthly expences. For each month i enter data day by
day starting B7. Each month is diferent from the previous month( B100 for
Jan. and B60 for February).
I need to create a macro (will run when click on a buton on the sheet) to
print the range from A7:E???
Where ??? refers to the last line in colomn B.

What is the code that should be used in the macro (using VBA) to determin
the first empty row in colomn B and use it to print these daily expences.

Hope I'm clear.

Khalil Handal
 
M

mangesh_yadav

range("B65536").End(xlUp).Offset(1,0)
is the first blank cell after the last filled cell in column B

Manges
 
D

Duke Carey

This will set the range variable rng to A7:En where n is the row of the last
used cell in column B

Set rng = Range(Cells(7, 1), Cells(Range("B65536").End(xlUp).Row, 5))
 
K

Khalil Handal

Thanks for for the info, another thing please:

to print the range i will use something like:
selection.printout
or rng printout
???

can u help
Khalil
 

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