Duffman4576
New Member
- Joined
- Sep 9, 2013
- Messages
- 21
Hey Forum:
I have gotten stuck and am hoping for some help (admittly still learniing VBA, so be kind). So far I have written the below code:
Sub More_Adjustments()
Dim rng As Range
Set rng = Sheets("Adjustments").Range("I8:I50")
For Each cell In rng
If Sheets("Adjustments").Range("I8") = Sheets("Adjustments").Range("I9") Then
Sheets("Adjustments").Range("K9:P9").Copy
Sheets("Report").Activate
Range(Sheets("Inputs").Range("H5").Value).Select
Selection.PasteSpecial xlPasteValues
Else:
End If
Next
End Sub
What I am tring to accomplish is this:
in the Adjustments Sheets I8:I50 will have information. Essentially old and new. The logic I have used is if I9=I8 (these are names) then we have entered an adjustment.
That adjustment needs to be updated into the Report sheet.
So I have gotten this to work for 1 name, but can't seem to get it to move through the rest of the range.
I think I am going wrong using direct cell refeneces in If formula, but really I have no idea where to go next.
Thanks for any an all help.
I have gotten stuck and am hoping for some help (admittly still learniing VBA, so be kind). So far I have written the below code:
Sub More_Adjustments()
Dim rng As Range
Set rng = Sheets("Adjustments").Range("I8:I50")
For Each cell In rng
If Sheets("Adjustments").Range("I8") = Sheets("Adjustments").Range("I9") Then
Sheets("Adjustments").Range("K9:P9").Copy
Sheets("Report").Activate
Range(Sheets("Inputs").Range("H5").Value).Select
Selection.PasteSpecial xlPasteValues
Else:
End If
Next
End Sub
What I am tring to accomplish is this:
in the Adjustments Sheets I8:I50 will have information. Essentially old and new. The logic I have used is if I9=I8 (these are names) then we have entered an adjustment.
That adjustment needs to be updated into the Report sheet.
So I have gotten this to work for 1 name, but can't seem to get it to move through the rest of the range.
I think I am going wrong using direct cell refeneces in If formula, but really I have no idea where to go next.
Thanks for any an all help.