butters149
New Member
- Joined
- Mar 21, 2018
- Messages
- 23
Hey everyone,
My first post here and I am also fairly new to VBA but I've been having some minor success with just trial and error. My most frustrating struggle so far is the loop function. Below is the function I am trying to do. Basically I want to search for Collector, move to the cell next to it which is blank and add a #. I have to do this because my other vba macro will stop selection if it see a blank cell. I want to find all Collector and then replace the blank cell next to it with a #.
Sub Macro20()
'
' Macro20 Macro
'
' Keyboard Shortcut: Ctrl+g
'
Do
Cells.Find(What:="Collector", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Activate
ActiveCell.Offset(0, -1).Select
ActiveCell.FormulaR1C1 = "#"
If Not foundCell Is Nothing Then
Exit Do
Loop
End Sub
My first post here and I am also fairly new to VBA but I've been having some minor success with just trial and error. My most frustrating struggle so far is the loop function. Below is the function I am trying to do. Basically I want to search for Collector, move to the cell next to it which is blank and add a #. I have to do this because my other vba macro will stop selection if it see a blank cell. I want to find all Collector and then replace the blank cell next to it with a #.
Sub Macro20()
'
' Macro20 Macro
'
' Keyboard Shortcut: Ctrl+g
'
Do
Cells.Find(What:="Collector", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Activate
ActiveCell.Offset(0, -1).Select
ActiveCell.FormulaR1C1 = "#"
If Not foundCell Is Nothing Then
Exit Do
Loop
End Sub