ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 880
- Office Version
- 365
- 2019
- Platform
- Windows
Hello,
Hoping someone could assist me on existing code that I have that should be copying data down but it is currently going too far up even though I define the range to start at row 3. So it is overriding my headers on row 2. Anyone able to see anything visibly wrong, I cannot and it is becoming annoying.
Before Code
After Code
Hoping someone could assist me on existing code that I have that should be copying data down but it is currently going too far up even though I define the range to start at row 3. So it is overriding my headers on row 2. Anyone able to see anything visibly wrong, I cannot and it is becoming annoying.
VBA Code:
Dim lr As Long, lr1 As Long
'formatting and formulas for recon sheet
With WsNXF
lr1 = .Cells(rows.count, "A").End(xlUp).row
.Range("A:B").RemoveDuplicates Columns:=Array(1, 2), Header:=xlYes
.Range("A:C").HorizontalAlignment = xlCenter
.Range("C2:T2") = Array("Concatentate A/C", "Prior BD", "Shares", "Income", "P", "B", "LT", "P", "B", "ST", "P", "B", "GAIN", "P", "B", "Total", "P", "B")
.Range("F1:O1") = Array("", "", "", "LT", "", "", "ST", "", "", "GAIN")
.Range("C3:C" & lr1).Formula = "=$A3&B3"
.Range("C3:C" & lr1).Value = .Range("C3:C" & lr1).Value
.Range("D3:D" & lr1).Formula = "=iferror(VLOOKUP(C3,'Trend_NX'!$C$11:$E$10000,3,FALSE),"""")"
.Range("E3:E" & lr1).Formula = "=iferror(VLOOKUP(C3,'Trend'!$C$11:$F$10000,4,FALSE),"""")"
.Range("F3:F" & lr1).Formula = "=SUMIF('ACC'!$C$10:$C$10000,$A3,'FOF ACCRUAL'!$G$10:$G$10000)"
'ADDITIONAL CODE to column T similar as above
Before Code
After Code