Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default reading cell contents in a macro

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!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
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!!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to transfer contents of 'Selected' cell to alternate cell. Gryndar Excel Worksheet Functions 7 December 20th 08 09:58 PM
Reading contents Fiona Excel Discussion (Misc queries) 3 June 28th 07 02:56 AM
Macro that looks at cell contents teamwill Excel Discussion (Misc queries) 2 January 10th 06 01:38 AM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
Browsing to URL and reading contents Mike[_49_] Excel Programming 9 November 20th 03 07:53 PM


All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"