Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hi Please can you help, I have the code below where for example in cell BK1 I have the word "ETA" and I want to copy this over in A@ and down to last row. and then I want to copy the data from "FMUI" sheet into "New" sheet, but I keep get errors. please can you help.
[/CODE]Private Sub CommandButton1_Click()
Range("BK1").Copy Range("A2").End(xlDown)).SelectWorksheets(“FMUI”). Range("C2", Range("C2").End(xlDown)).NumberFormat= "0" = Worksheets(“New”).Range(“B2”).Value
Worksheets(“FMUI”). Range("E2", Range("E2").End(xlDown)).Copy= Worksheets(“New”).Range(“G2”).Value
Worksheets(“FMUI”). Range("F2", Range("F2").End(xlDown)).Copy= Worksheets(“New”).Range(“AH2”).Value
Worksheets(“FMUI”). Range("F2", Range("F2").End(xlDown)).Copy= Worksheets(“New”).Range(“AI2”).Value
Worksheets(“FMUI”). Range("L2", Range("L2").End(xlDown)).Copy= Worksheets(“New”).Range(“H2”).Value
Worksheets(“FMUI”). Range("M2", Range("M2").End(xlDown)).Copy= Worksheets(“New”).Range(“S2”).Value
Worksheets(“FMUI”). Range("S2", Range("S2").End(xlDown)).Copy= Worksheets(“New”).Range(“AG2”).Value
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("R2:R" & lr)
.Formula ="=VLOOKUP(B2,Old!B:R,17,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
With Range("E2:E" & lr)
.Formula = "=VLOOKUP(B2,Old!B:E,4,FALSE)"
.Value = .Value
End With
End Sub
[/CODE]
[/CODE]Private Sub CommandButton1_Click()
Range("BK1").Copy Range("A2").End(xlDown)).SelectWorksheets(“FMUI”). Range("C2", Range("C2").End(xlDown)).NumberFormat= "0" = Worksheets(“New”).Range(“B2”).Value
Worksheets(“FMUI”). Range("E2", Range("E2").End(xlDown)).Copy= Worksheets(“New”).Range(“G2”).Value
Worksheets(“FMUI”). Range("F2", Range("F2").End(xlDown)).Copy= Worksheets(“New”).Range(“AH2”).Value
Worksheets(“FMUI”). Range("F2", Range("F2").End(xlDown)).Copy= Worksheets(“New”).Range(“AI2”).Value
Worksheets(“FMUI”). Range("L2", Range("L2").End(xlDown)).Copy= Worksheets(“New”).Range(“H2”).Value
Worksheets(“FMUI”). Range("M2", Range("M2").End(xlDown)).Copy= Worksheets(“New”).Range(“S2”).Value
Worksheets(“FMUI”). Range("S2", Range("S2").End(xlDown)).Copy= Worksheets(“New”).Range(“AG2”).Value
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("R2:R" & lr)
.Formula ="=VLOOKUP(B2,Old!B:R,17,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
With Range("E2:E" & lr)
.Formula = "=VLOOKUP(B2,Old!B:E,4,FALSE)"
.Value = .Value
End With
End Sub
[/CODE]