Hi all, I'm new in the world of xlookup and macros. I had to redo my recorded macros because .select is a bad habit to get used to, so I redid my entire macros, and now it works really well when I call it from a button.
Anyway, my macro is this:
Basically I have 2 sheets, SDS003b is where the info will be search and Data is where the result will show up.
My question is, instead of doing another macros for column SDS003bV:V which is the one following the previous macro already mentioned, is there a way to add or spill the Xlookup to multiple columns?
I tried doing something like which it filed just column U with info but all the rest filled with zeros:
Hope it make sense what Im asking.
Anyway, my macro is this:
VBA Code:
Sub SDS1()
'
' SDS Macro
'
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Data")
With ws.Range("U2:U" & ws.Range("D" & Rows.Count).End(xlUp).Row)
.Formula = "=XLOOKUP(D2,'SDS003b'!I:I,'SDS003b'!U:U,"""")"
.Value = .Value
End With
End Sub
My question is, instead of doing another macros for column SDS003bV:V which is the one following the previous macro already mentioned, is there a way to add or spill the Xlookup to multiple columns?
I tried doing something like which it filed just column U with info but all the rest filled with zeros:
VBA Code:
Sub SDS1()
'
' SDS Macro
'
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Data")
With ws.Range("U2:Z" & ws.Range("D" & Rows.Count).End(xlUp).Row)
.Formula = "=XLOOKUP(D2,'SDS003b'!I:I,'SDS003b'!U:Z,"""")"
.Value = .Value
End With
End Sub
Hope it make sense what Im asking.