Need VB code fix

T

TKD Karen

I'm pretty new to the Excel VBA and need help with reading values in a cell.
I keep getting some kind of global error whenever I use the Value property.
How should the following code read?

'loop through all of the records on ConvertToFile and copy each row to the
appropriate spreadsheet
Worksheets("FileToConvert").Activate
Range("A5").Select
Do While Not Range(ActiveCell).Value = ""
Select Case Range(ActiveCell).Offset(0, 12).Value
End Select
Range(ActiveCell).Offset(1,0).Select 'move down to the next row
Loop

I have much assigning for cell values but don't know the proper coding.
Please Help!
 
D

Dave Peterson

Activecell is already a range.

You could do:

Worksheets("FileToConvert").Activate
Range("A5").Select
Do While Not ActiveCell.Value = ""
Select Case ActiveCell.Offset(0, 12).Value
'case is = "what goes here"
End Select
ActiveCell.Offset(1,0).Select 'move down to the next row
Loop
 
T

TKD Karen

Thanks! That did the trick.
Karen

Dave Peterson said:
Activecell is already a range.

You could do:

Worksheets("FileToConvert").Activate
Range("A5").Select
Do While Not ActiveCell.Value = ""
Select Case ActiveCell.Offset(0, 12).Value
'case is = "what goes here"
End Select
ActiveCell.Offset(1,0).Select 'move down to the next row
Loop
 

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