slightly confused - object reference

P

PBcorn

i have code looking a little like this:

sub test()

dim sht as worksheet
dim cll as range

for each sht in thisworkbook.worksheets

<more code here>

for each cll in sht.usedrange.columns(2).cells

sht.range(cll).select*

<code to do soething with selection>

next cll

next sht


the problem is that the starred line is wrong, but i have tried everything
from sht.cll.select to sht.range("cll").select nothing works. I Just want to
select the cell so i can insert a row above it. Any help appreciated.

end sub
 
B

Bob Phillips

Try just

cll.Select

you have already drilled down to the individual cell, so you don't need the
sheet reference.

YOu don't need to select you could just referernce cll.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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