Hi community,
I am quite new of using invoke code, I have below vba coding but I have to do it via using invokde code, activity, can anyone help or any documents to study?
Sub Mappingwithreport()
Dim ws As Worksheet
Dim wsName, wsReport As String
Dim lrow As Long
wsName = "sheet1"
weReport = "sheet2"
Set ws = ThisWorkbook.Sheets.Add(After:= _
ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
ws.Name = wsName
Sheets(wsName).Activate
Range("B5").Value = "Row1"
Range("C5").Value = "123"
Range("B6").Value = "Row2"
Range("C6").Value = "246"
Range("B7").Value = "Row3"
Range("C7").Value = "357"
Range("B8").Value = "Row4"
Range("C8").Value = "468"
Sheets(weReport).Activate
lrow = Cells(Rows.Count, 1).End(xlUp).Row
Range("M1").Value = "First"
Range("M2").Formula = "=D2&LEFT(E2,3)"
Range("M2").Copy
Range("M2:M" & lrow).PasteSpecial (xlPasteAll)
Range("N1").Value = "Second"
Range("N2").Formula = "=IF(G2>0,""1690"",""2690"")"
Range("N2").Copy
Range("N2:N" & lrow).PasteSpecial (xlPasteAll)
Range("O1").Value = "Third"
Range("O2").Formula = "=VLOOKUP(M2," & wsName & "!B:C,2,FALSE)"
Range("O2").Copy
Range("O2:O" & lrow).PasteSpecial (xlPasteAll)
End Sub