Nitehawkhp
New Member
- Joined
- Dec 2, 2016
- Messages
- 37
Greetings,
I'm trying to author a VBA script that will find information in column G based on criteria found in column N and replace the information in column G with the information in column O.
Here's a snipit of what my worksheet looks like:
<tbody>
</tbody>
Error code 91 (object variable not set) occurs when the RED section of code is executed.
I have looked the error up, but I don't understand how to fix the error.
Thanks to anyone that can help me resolve the error.
Rod
I'm trying to author a VBA script that will find information in column G based on criteria found in column N and replace the information in column G with the information in column O.
Here's a snipit of what my worksheet looks like:
F | G | H | N | O |
Date | Description | Amount | Find | Replace |
Jan 5, 2018 | ACH Debit BOISE CITY UTILI FIRST TECH FCU B - BILL PAYMT | $ 40.78 | *BOISE CITY* | BOISE CITY UTILITIES - BILL PAYMT |
Feb 5, 2018 | ACH Debit BOISE CITY UTILI FIRST TECH FCU B - BILL PAYMT | $ 40.78 | *BOISE CITY* | BOISE CITY UTILITIES - BILL PAYMT |
Mar 5, 2018 | ACH Debit BOISE CITY UTILI FIRST TECH FCU B - BILL PAYMT | $ 40.78 | *BOISE CITY* | BOISE CITY UTILITIES - BILL PAYMT |
Jan 5, 2018 | ACH Debit INTERMOUNTAIN GA FIRST TECH FCU B - BILL PAYMT | $ 42.00 | *INTERMOUNTAIN GA* | INTERMOUNTAIN GAS - BILL PAYMT |
Feb 5, 2018 | ACH Debit INTERMOUNTAIN GA FIRST TECH FCU B - BILL PAYMT | $ 42.00 | *INTERMOUNTAIN GA* | INTERMOUNTAIN GAS - BILL PAYMT |
Mar 5, 2018 | ACH Debit INTERMOUNTAIN GA FIRST TECH FCU B - BILL PAYMT | $ 42.00 | *INTERMOUNTAIN GA* | INTERMOUNTAIN GAS - BILL PAYMT |
Apr 5, 2018 | POS Transaction ST ALPHONSUS BOISE PE 1055 N CURTIS RD | $ 169.00 | *SAINT ALPHONSUS* | SAINT ALPHONSUS |
Apr 5, 2018 | POS Transaction ST ALPHONSUS BOISE PE 1055 N CURTIS RD | $ 28.42 | *SAINT ALPHONSUS* | SAINT ALPHONSUS |
Apr 5, 2018 | POS Transaction ST ALPHONSUS BOISE PE 1055 N CURTIS RD | $ 78.00 | *SAINT ALPHONSUS* | SAINT ALPHONSUS |
<tbody>
</tbody>
Code:
Sub DescriptionFINDandREPLACE()
'
' Description FIND and REPLACE
'
For Counter = 6 To 60
Range("CheckbookDescription").Select
Findit = Range("N" & Counter)
Replaceit = Range("O" & Counter)
[COLOR=#ff0000] Selection.Find(What:="Findit", After:=ActiveCell, LookIn:= _[/COLOR]
[COLOR=#ff0000] xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _[/COLOR]
[COLOR=#ff0000] xlNext, MatchCase:=False, SearchFormat:=False).Activate[/COLOR]
Selection.Replace What:="Findit", Replacement:= _
"Replaceit", LookAt:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
Next
End Sub
Error code 91 (object variable not set) occurs when the RED section of code is executed.
I have looked the error up, but I don't understand how to fix the error.
Thanks to anyone that can help me resolve the error.
Rod