View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default reading cell contents in a macro

Needin',

Sub test()
Dim i As Long

i = 0
With Sheet1.Cells(1, 1)
Do Until .Offset(i, 0).Value = "99999"
If .Offset(i, 0).Value Like "J*" Then
Debug.Print "J Something"
ElseIf .Offset(i, 0).Value Like "K*" Then
Debug.Print "K Something"
Else
Debug.Print "Something Else"
End If

i = i + 1
Loop
End With
End Sub


Rob


"needin' help" wrote in message
...
How do I program a macro to read the contents of a cell:
- letters
- numbers
The last row in my spreadsheet has a value of 99999.
Need to loop until the cell value = 99999 - how do i do this?
While looping I need to take action only if a certain letter is

encountered in a cell - if the letter is "J" I need to run another macro.

Is anyone able to help?

Please & Thanks!!