LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default For each this, then that and that

If I drop the "X" part, the below will shade the cells I want. I just can't
get the syntax for adding - ActiveCell.Offset(0, 1) = "X".

I have tried several versions of this with only undesired results.

Any help would be appreciated. Thank in advance
wal50

Sub MarkCells()
Dim Cell As Range
Dim MarkThis As String
MarkThis = Application.InputBox("Enter Value to Mark", Type:=2)
Set rng = Application.InputBox("Enter Range to check -
A1:A20", Type:=8)
rng.Select
For Each Cell In Selection
If Cell.Value = MarkThis Then
Cell.Interior.ColorIndex = 4 And
ActiveCell.Offset(0, 1) = "X"
Next Cell
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



All times are GMT +1. The time now is 09:53 PM.

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"