malleshg24
11-05-2017, 07:55 PM
Hi Team,:help
The below codes formula work for me, however in each sheet column B is getting selected
I want range ("a1") to get selected by default.
I tried application.cutcopymode = false but no luck. plz assist. Thanks.
Sub Test()
Dim ws As Worksheet, lr As Long
For Each ws In Worksheets
Select Case ws.Name
Case "Sheet1", "Sheet2", "Sheet5"
lr = ws.Cells(Rows.Count, "A").End(xlUp).Row
ws.Range("B2:B" & lr).Formula = "=VLOOKUP(A2,data,2,FALSE)"
End Select
Next ws
End Sub
The below codes formula work for me, however in each sheet column B is getting selected
I want range ("a1") to get selected by default.
I tried application.cutcopymode = false but no luck. plz assist. Thanks.
Sub Test()
Dim ws As Worksheet, lr As Long
For Each ws In Worksheets
Select Case ws.Name
Case "Sheet1", "Sheet2", "Sheet5"
lr = ws.Cells(Rows.Count, "A").End(xlUp).Row
ws.Range("B2:B" & lr).Formula = "=VLOOKUP(A2,data,2,FALSE)"
End Select
Next ws
End Sub