
Originally Posted by
Dhruva101
Yes. In fact I am looking for a Macro only to dit more nicely.
the code would be something like
Option Explicit
Sub SpreadVLookup()
Dim ws As Worksheet
Dim iLastRow As Long
For Each ws In ActiveWorkbook.Worksheets
iLastRow = ActiveSheet.Range("A65536").End(xlUp).Row
If iLastRow < 2 Then iLastRow = 2 ' testing
ws.Range("B2:B" & iLastRow).Formula = "=IF(ISNA(VLOOKUP(C2,LOTHER,2,0)),""SR#NA"",VLOOKUP(C2,LOTHER,2,0))"
' more of these? ws.Range("C2:C" & iLastRow).Formula = "=IF(ISNA(VLOOKUP(C2,LOTHER,2,0)),""SR#NA"",VLOOKUP(C2,LOTHER,2,0))"
Range("B1:I" & iLastRow).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Next ws
End Sub
but you will need to specify
the column to determine the last row used
what in the names range LOTHER
which columns need to have a formula, and what formula for each column
---
Bookmarks