Need help with For Each c In Worksheets("CV Table").Range("B:B").C

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to run through a column using the:

For Each c In Worksheets("CV Table").Range("B:B").Cells,

statement but I want to start at Cell(6,6) all the way down to the last cell
in coulmn B:B with a value in it. How do I write the code for this. Thanks
 
try this idea
with Worksheets("CV Table")
lr=.cells(rows.count,"b").end(xlup).row
for each c in .range(.cells(6,6),.cells(lr,6))
'do your thing
next c
end with
 
Hi,

You don't actually tell us what you want to do and there is no cell(6,6) in
column B so I have assumed row 6.Try this:-

Sub sonic()
Dim myRange As Range
lastrowcolb = Worksheets("CV Table").Range("B65536").End(xlUp).Row
Set myRange = Worksheets("CV Table").Range("B6:B" & lastrowcolb)
For Each c In myRange
'do something
Next c
End Sub


Mike
 
Use:

n = Cells(Rows.Count, "B").End(xlUp).Row
Set r = Worksheets("CV Table").Range("B1:B" & n)
For Each c In r
 

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

Back
Top