I'm trying to use vLookup to return a value that will allow the automatic placement of expenditures in the correct account (i.e. column). To do this I've created an enum
Enum BudgetItem
Redacted 1
Entertainment
Kickstarter
AutoIns
Food
Autos
Gas
Misc
House
EatingOut
Clothes
Vacation
ManCave
Redacted 2
End Enum
The vLookup is returning the correct value but I'm not currently able to convert the value returned to copy the value to the correct account.
The code is
For Each rMcell In rAmex
v = Application.VLookup(rMcell, shtDescriptionDataSheet.Range("c1:" & strDescriptionDataLastCell).Value, 2, False)
If IsError(v) Or IsEmpty(v) Then
Else
a = BudgetItem.v + 1 ' This gives the error 'Method or data member not found. + 1
' Copy the amount to the proper account column
ActiveCell.Offset(0, 2).Select ' The expenditure is located in this cell.
Selection.Copy
a = a + 2
ActiveCell.Offset(0, a).Select ' This is where the expenditure is to be copied.
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End If
Next
I've tried a number of other possibilities, none of which have worked. I've also done a lot of searches without any luck.
The enum is in module 1. I've tried making it public but shouldn't have to as I currently understand things (It didn't work anyway).
The rest of the code is in one of the sheets of the excel file and the work is being done in another sheet.
I want to do it this way because accounts come and go as life rolls on.
Thanks in advance for any help that is provided.
Enum BudgetItem
Redacted 1
Entertainment
Kickstarter
AutoIns
Food
Autos
Gas
Misc
House
EatingOut
Clothes
Vacation
ManCave
Redacted 2
End Enum
The vLookup is returning the correct value but I'm not currently able to convert the value returned to copy the value to the correct account.
The code is
For Each rMcell In rAmex
v = Application.VLookup(rMcell, shtDescriptionDataSheet.Range("c1:" & strDescriptionDataLastCell).Value, 2, False)
If IsError(v) Or IsEmpty(v) Then
Else
a = BudgetItem.v + 1 ' This gives the error 'Method or data member not found. + 1
' Copy the amount to the proper account column
ActiveCell.Offset(0, 2).Select ' The expenditure is located in this cell.
Selection.Copy
a = a + 2
ActiveCell.Offset(0, a).Select ' This is where the expenditure is to be copied.
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End If
Next
I've tried a number of other possibilities, none of which have worked. I've also done a lot of searches without any luck.
The enum is in module 1. I've tried making it public but shouldn't have to as I currently understand things (It didn't work anyway).
The rest of the code is in one of the sheets of the excel file and the work is being done in another sheet.
I want to do it this way because accounts come and go as life rolls on.
Thanks in advance for any help that is provided.