Hello World
I have the following code which opens hyperlink and populates specific sheet with information,saves and closes. This works well for my first hyperlink in Range("C7"). I have hyperlinks down the entire column C. How can I amend code to add a loop to go down column and populate all linked sheets.
Sub StatPop()
Dim rng As Range
Application.ScreenUpdating = False
Application.EnableEvents = False
Sheets("Payment transactions").Activate
Range("C7").Hyperlinks(1).Follow
Sheets("Statement").Activate
Set rng = ThisWorkbook.Sheets("Payment Transactions").Range("J7")
If rng = "50% Deposit" Then
Sheets("Statement").Range("b14").Value = ThisWorkbook.Sheets("Payment Transactions").Range("I7").Value
Sheets("Statement").Range("c14").Value = ThisWorkbook.Sheets("Payment Transactions").Range("J7").Value
Sheets("Statement").Range("d14").Value = ThisWorkbook.Sheets("Payment Transactions").Range("H7").Value
Else
If rng = "30% Payment" Then
Sheets("Statement").Range("b15").Value = ThisWorkbook.Sheets("Payment Transactions").Range("I7").Value
Sheets("Statement").Range("c15").Value = ThisWorkbook.Sheets("Payment Transactions").Range("J7").Value
Sheets("Statement").Range("d15").Value = ThisWorkbook.Sheets("Payment Transactions").Range("H7").Value
Else
Sheets("Statement").Range("b16").Value = ThisWorkbook.Sheets("Payment Transactions").Range("I7").Value
Sheets("Statement").Range("c16").Value = ThisWorkbook.Sheets("Payment Transactions").Range("J7").Value
Sheets("Statement").Range("d16").Value = ThisWorkbook.Sheets("Payment Transactions").Range("H7").Value
End If
End If
ThisWorkbook.Saved = True
Application.ScreenUpdating = True
Application.EnableEvents = True
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
Bookmarks