Looping through columns

M

Mick

Hi

Want to use the isEmpty function to examine cells dependent on column
(e.g. B1, C1, D1)

If B1 has data in it then insert data into C1 etc. Doing this with
rows is easy by substituting the row number with a variable (x) so

range("sheet1!a & x")

How do I substitute the column reference? Do i need to use R1C1
referencing?

Thanks

Mick
 
C

Conan Kelly

Mick,

You can use Cellls(RowNbr,ColumnNbr) in place of Range(). So...

Cells(1,1) is A1
Cells(1,2) is B1
Cells(2,1) is A2

....then substitute variables for both rows and columns. Maybe something
like "plngRow" and "plngColumn":

Cells(plngRow,plngColumn)

HTH,

Conan
 

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