Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Mimi's range selection macro

  Asked By: Colleen    Date: Feb 02    Category: MS Office    Views: 1590
  

This'll do it:

Sub Mimi()
Dim targRange As Range

For Each sh In Worksheets
With sh.Range("a1:a100")
Set c = .Find("Operating Projects")
If Not c Is Nothing Then
firstAddress = c.Offset(1, 2).Address
Set c = .FindNext(c)
If Not c Is Nothing Then
lastAddress = c.Offset(-1, 2).Address
If firstAddress = lastAddress Then
Set targRange = sh.Range(firstAddress)
Else
Set targRange = sh.Range(firstAddress & ":" &
lastAddress)
End If
For Each cl In targRange
cl.Value = "O"
Next
End If
End If
End With
Next

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Harold Graham     Answered On: Feb 02

I am so grateful for your help, you saved me hours and hours of work. It works
like a charm.

 
Didn't find what you were looking for? Find more on Mimi's range selection macro Or get search suggestion and latest updates.




Tagged: