F
Fishnerd
This seems like it should be fairly simple, but for the life of me, I can
figure out the correct command. I'm writing a macro that loops through a
database comparing all rows and when the a statement is true, and if it is,
it adds a reference/link to the contents of Cell(y, r) to the current formula
of Cell(x, qr). This way, if Cell(y,r) changes later, Cell(x,qr)
automatically changes as well. The end result is each cell in column qr will
have formulas that are the equivelent of =SUM(B3,B12,B56).
Here is what I've got so far... "Ref" in the macro is simply what I wish the
command was, but unfortunately it doesn't exist...
Do While Cells(x, name).Value <> ""
Do While Cells(y, name).Value <> ""
If (Cells(x, name).Value = Cells(y, name).Value) Then
Cells(x, qr).Formula = Cells(x, qr).Formula + Cells(y, r).Ref
y = y + 1
Else
y = y + 1
End If
Loop
x = x + 1
y = 2
Loop
Thanks for any help you can offer. I hope I at least made a little sense in
my explanation... couldn't think how to better word it...
figure out the correct command. I'm writing a macro that loops through a
database comparing all rows and when the a statement is true, and if it is,
it adds a reference/link to the contents of Cell(y, r) to the current formula
of Cell(x, qr). This way, if Cell(y,r) changes later, Cell(x,qr)
automatically changes as well. The end result is each cell in column qr will
have formulas that are the equivelent of =SUM(B3,B12,B56).
Here is what I've got so far... "Ref" in the macro is simply what I wish the
command was, but unfortunately it doesn't exist...
Do While Cells(x, name).Value <> ""
Do While Cells(y, name).Value <> ""
If (Cells(x, name).Value = Cells(y, name).Value) Then
Cells(x, qr).Formula = Cells(x, qr).Formula + Cells(y, r).Ref
y = y + 1
Else
y = y + 1
End If
Loop
x = x + 1
y = 2
Loop
Thanks for any help you can offer. I hope I at least made a little sense in
my explanation... couldn't think how to better word it...