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:
[TABLE="class: grid, width: 1100"]
<tbody>[TR]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]O[/TD]
[/TR]
[TR]
[TD]Date[/TD]
[TD]Description[/TD]
[TD]Amount[/TD]
[TD]Find[/TD]
[TD]Replace[/TD]
[/TR]
[TR]
[TD]Jan 5, 2018[/TD]
[TD]ACH Debit BOISE CITY UTILI FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 40.78[/TD]
[TD]*BOISE CITY*[/TD]
[TD]BOISE CITY UTILITIES - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Feb 5, 2018[/TD]
[TD]ACH Debit BOISE CITY UTILI FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 40.78[/TD]
[TD]*BOISE CITY*[/TD]
[TD]BOISE CITY UTILITIES - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Mar 5, 2018[/TD]
[TD]ACH Debit BOISE CITY UTILI FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 40.78[/TD]
[TD]*BOISE CITY*[/TD]
[TD]BOISE CITY UTILITIES - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Jan 5, 2018[/TD]
[TD]ACH Debit INTERMOUNTAIN GA FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 42.00[/TD]
[TD]*INTERMOUNTAIN GA*[/TD]
[TD]INTERMOUNTAIN GAS - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Feb 5, 2018[/TD]
[TD]ACH Debit INTERMOUNTAIN GA FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 42.00[/TD]
[TD]*INTERMOUNTAIN GA*[/TD]
[TD]INTERMOUNTAIN GAS - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Mar 5, 2018[/TD]
[TD]ACH Debit INTERMOUNTAIN GA FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 42.00[/TD]
[TD]*INTERMOUNTAIN GA*[/TD]
[TD]INTERMOUNTAIN GAS - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Apr 5, 2018[/TD]
[TD]POS Transaction ST ALPHONSUS BOISE PE 1055 N CURTIS RD[/TD]
[TD="align: right"]$ 169.00[/TD]
[TD]*SAINT ALPHONSUS*[/TD]
[TD]SAINT ALPHONSUS[/TD]
[/TR]
[TR]
[TD]Apr 5, 2018[/TD]
[TD]POS Transaction ST ALPHONSUS BOISE PE 1055 N CURTIS RD[/TD]
[TD="align: right"]$ 28.42[/TD]
[TD]*SAINT ALPHONSUS*[/TD]
[TD]SAINT ALPHONSUS[/TD]
[/TR]
[TR]
[TD]Apr 5, 2018[/TD]
[TD]POS Transaction ST ALPHONSUS BOISE PE 1055 N CURTIS RD[/TD]
[TD="align: right"]$ 78.00[/TD]
[TD]*SAINT ALPHONSUS*[/TD]
[TD]SAINT ALPHONSUS[/TD]
[/TR]
</tbody>[/TABLE]
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:
[TABLE="class: grid, width: 1100"]
<tbody>[TR]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]O[/TD]
[/TR]
[TR]
[TD]Date[/TD]
[TD]Description[/TD]
[TD]Amount[/TD]
[TD]Find[/TD]
[TD]Replace[/TD]
[/TR]
[TR]
[TD]Jan 5, 2018[/TD]
[TD]ACH Debit BOISE CITY UTILI FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 40.78[/TD]
[TD]*BOISE CITY*[/TD]
[TD]BOISE CITY UTILITIES - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Feb 5, 2018[/TD]
[TD]ACH Debit BOISE CITY UTILI FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 40.78[/TD]
[TD]*BOISE CITY*[/TD]
[TD]BOISE CITY UTILITIES - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Mar 5, 2018[/TD]
[TD]ACH Debit BOISE CITY UTILI FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 40.78[/TD]
[TD]*BOISE CITY*[/TD]
[TD]BOISE CITY UTILITIES - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Jan 5, 2018[/TD]
[TD]ACH Debit INTERMOUNTAIN GA FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 42.00[/TD]
[TD]*INTERMOUNTAIN GA*[/TD]
[TD]INTERMOUNTAIN GAS - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Feb 5, 2018[/TD]
[TD]ACH Debit INTERMOUNTAIN GA FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 42.00[/TD]
[TD]*INTERMOUNTAIN GA*[/TD]
[TD]INTERMOUNTAIN GAS - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Mar 5, 2018[/TD]
[TD]ACH Debit INTERMOUNTAIN GA FIRST TECH FCU B - BILL PAYMT[/TD]
[TD="align: right"]$ 42.00[/TD]
[TD]*INTERMOUNTAIN GA*[/TD]
[TD]INTERMOUNTAIN GAS - BILL PAYMT[/TD]
[/TR]
[TR]
[TD]Apr 5, 2018[/TD]
[TD]POS Transaction ST ALPHONSUS BOISE PE 1055 N CURTIS RD[/TD]
[TD="align: right"]$ 169.00[/TD]
[TD]*SAINT ALPHONSUS*[/TD]
[TD]SAINT ALPHONSUS[/TD]
[/TR]
[TR]
[TD]Apr 5, 2018[/TD]
[TD]POS Transaction ST ALPHONSUS BOISE PE 1055 N CURTIS RD[/TD]
[TD="align: right"]$ 28.42[/TD]
[TD]*SAINT ALPHONSUS*[/TD]
[TD]SAINT ALPHONSUS[/TD]
[/TR]
[TR]
[TD]Apr 5, 2018[/TD]
[TD]POS Transaction ST ALPHONSUS BOISE PE 1055 N CURTIS RD[/TD]
[TD="align: right"]$ 78.00[/TD]
[TD]*SAINT ALPHONSUS*[/TD]
[TD]SAINT ALPHONSUS[/TD]
[/TR]
</tbody>[/TABLE]
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