View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jen_T Jen_T is offline
external usenet poster
 
Posts: 66
Default How to update a range of cells if cell value is equal to...

I am having trouble with a piece of code in excel 2007 where I would like to
check a cell value in column "W" which is column 23, if equal to "Y" than
update from columns "X:BV" row 2 to last row the value to "N", if not do
nothing.

I have attached the code I am currently using:

Dim rowCounter As Double
Dim bottomRow As Double


For rowCounter = 2 To bottomRow
If Sheet7.Cells(rowCounter, 23).Value = "Y" Then
Sheet7.Range("X" + Trim(Str(rowCounter)) + ":BV" + _
Trim(Str(rowCounter))).Value = "N"
End If
Next rowCounter
Any suggestions would be greatly appreciated. Thank you