Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hi I have the code below where I copy data from Range AL2 to paste into B2 but the numbers look like 2.7Ex12 and I want this to show as 2700444444444 for example how can I amend that in the code? it is the first line below
Code:
Private Sub CommandButton2_Click()
Range("AL2", Range("AL2").End(xlDown)).Copy Range("B2")
Range("G2", Range("G2").End(xlDown)).Copy Range("D2")
Range("AH2", Range("AH2").End(xlDown)).Copy Range("AI2")
Dim lr As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
With Range("C2:C" & lr)
.Formula = "=VLOOKUP(B2,Old!B:C,2,FALSE)"
.Value = .Value
End With
With Range("E2:E" & lr)
.Formula = "=VLOOKUP(B2,Old!B:E,4,FALSE)"
.Value = .Value
End With
With Range("AJ2:AJ" & lr)
.Formula = "=VLOOKUP(LEFT(AI2,LEN(AI2)-2),PC!A:B,2,FALSE)"
.Value = .Value
End With
End Sub