Color the cell when spell check fails for particular colmun

talk2naga

New Member
Joined
Jan 6, 2014
Messages
6
Hi
I have written the below macro for my requirement which is

1. I need do a spell check for all the cells in column H which has 300000 rows
2. Highlight the cells which fails in spell check ( can ignore blanks)
3. And also I need to update the adjacent cell in column G with text "Error" , when spell check fails ( not aware how to code that)

The macro below fails and i'm not sure of the issue

Sub Spell()
Dim rCell As Range
For Each h1 In Range("H2:H300000")
If Not Application.CheckSpelling(Word:=hl.Text) Then _
hl.Interior.ColorIndex = 28
Next
End Sub


Any help will be appreciated.

Thanks
Naga
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Sorry, there is a typo in the code. Below is the actaul code

Sub Trim()
Dim h1 As Range
For Each h1 In Range("H2:H300000")
If Not Application.CheckSpelling(Word:=hl.Text) Then _
hl.Interior.ColorIndex = 28
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,591
Members
449,174
Latest member
chandan4057

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top