Morning all!
I am having trouble with some coding, and would love some advice and help.
In the worksheet I am attaching, what I am trying to do is extract info from cells A:E and transposing them into columns G:J. For the purpose of what I want it to eventually look like, I basically copied and pasted the info in to cells M:P to illustrate.
This is the code I have come up with so far:
Sub TerminalReserve()
Dim TermReserve As Range
Dim Cell As Range
Dim DurationAddress As String
Dim PlanName As String
Dim IssueAge As String
Dim Duration As String
Dim Factor As String
Dim x As Integer
Dim PlanNameAddress As String
Dim rowdum As Variant
Dim counter As Integer
Dim ReserveName As String
Dim IssueNameAddress As String
Dim IssuingAge As String
Dim FactorAddress As String
Dim y As Integer
Dim i As Integer
'HardCoding of PlanName and Issue Age
ReserveName = "20000001"
IssuingAge = "10"
'Creating Duration, IssueAge, & PlanName Inputs
x = 1
While x < 4226
PlanNameAddress = "G" + VBA.Trim(Str(x + 1))
IssueNameAddress = "H" + VBA.Trim(Str(x + 1))
DurationAddress = "I" + VBA.Trim(Str(x + 1))
Range(DurationAddress).Value = x
x = x + 1
Range(PlanNameAddress).Value = ReserveName
Range(IssueNameAddress).Value = IssuingAge
Wend
'Selects TermReserve
Set TermReserve = Range("A1:E869")
TermReserve.Select
'Inputs for Factor Table
Range("J2:J" & Range("J" & Rows.Count).End(xlUp).Row).ClearContents
For i = 3 To 869
Range("A" & i, "E" & i).Copy
Range("J" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Transpose:=True
Next i
'Creating Table Header
PlanName = "PlanName"
Range("G1").Value = PlanName
IssueAge = "IssueAge"
Range("H1").Value = IssueAge
Duration = "Duration"
Range("I1").Value = Duration
Factor = "Factor"
Range("J1").Value = Factor
End Sub
It gives me the information I need up to row 101, but I need it loop and gather the rest of the data for me. The biggest problem I am having is with rows 105, 125, 145, 165, etc. The purpose of those rows is to tell me the issueage and duration, that's it. How do I create a continuous working loop to have it look like columns M:P?TerminalReserveMacro.xlsm
Bookmarks