So it's like Sheet R is the total for each account for the year, and Sheet 1 is the total for a certain month that needs to be added to the year. There may be multiples of the same account in Sheet 1, but not in Sheet R.
Sheet R
Column 1(A)=Account#
Column 2(B )=Name
Column 3(C )=2012 Total
Sheet 1Column 2(B )=Name
Column 3(C )=2012 Total
Column 1(A)=Account#
Column 12 (L)=Total
Column 12 (L)=Total
Now my default for all lookups has been to use VLookup, but it doesn't make sense to use here:
VLookup(Sheets("1").Cells(intRow, 2).value, Sheets("R").Columns("A:C"). [here is confusing part because I don't want to return anything]
Then I found online that you should use Match instead, which I have never used before. So I thought okay, find the matching #, get the address and assign as variable and add to that..
My attempt:
Dim addy As String
Dim intRow As Integer
Dim comm As Long, acctcomm As Long
intRow=2
addy = Address(Match(Sheets("1").Cells(intRow, 1).value, Sheets("R").Columns("A:C"), 0)
comm = Range(addy).Offset(0,2).value
comm = comm + acctcomm
Range(addy).Offset(0,2).value = comm
It's just turning out stupid, illogical, and inefficient. Please help!

New Topic/Question
Reply



MultiQuote




|