LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Cell by Cell Loop

I need help getting the syntax right for a loop...

This is what I am trying to accomplish:
Start in A2, run spell check on that cell only.
Go to the next cell in that row with data (if any, up to the last column)
and run
spell check on that cell only.

Go to the next cell in that row with data (if any, up to the last last
column) run
spell check on that cell only...etc.
Then move to Row 3 and do the same...
Then Row 4...then 5...etc. Until we hit the last row.

Can someone help me get the syntax right? I know this is probably a ways
off, but this is where I left off. (As you can see..need a lot of help...it
obviously doesn't work).

Sub SpellCheck3()

Dim LastRow As Long
Dim LastCol As Long
LastRow = ActiveSheet.Cells(Rows.Count, "C").End(xlUp).Row
LastCol = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
Debug.Print LastRow, LastCol
Set LastCell = ActiveSheet.Cells(LastRow, LastCol)

x = 2
z = 1

Do Until x = LastRow
Do Until z = LastCol
Set mc = ActiveSheet.Cells(x, z)
Application.Goto(ActiveSheet.Range(mc.convertformu la(formula:=mc,
FromReferenceStyle:=R1C1 _
, ToReferenceStyle:=A1)
Range(x.Address, z.Address).CheckSpelling SpellLang:=1033,
AlwaysSuggest:=True
z = z + 1
Loop
z = 1
x = x + 1
Loop
End Sub
 
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
Two Cell Loop amirstal Excel Programming 4 December 8th 06 01:11 PM
VBA Loop until certain cell! [email protected] Excel Programming 9 August 19th 06 06:00 PM
Loop to add +1 in cell? bxvang Excel Programming 5 June 7th 06 01:34 PM
Loop until cell is empty Ricky Pang Excel Programming 6 May 12th 06 05:14 PM
loop through a cell. Vincent Jones Excel Programming 2 June 2nd 04 10:39 PM


All times are GMT +1. The time now is 05:02 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"