Need VB code fix

  • Thread starter Thread starter TKD Karen
  • Start date Start date
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!
 
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
 
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
 
Back
Top