Good Day!
I have a template with 2 different macros which gets it's data from another input file.
1st Macro:
I need to first populate a list box based on the unique value of a certain column (AZ) of the input file. Once it's populated, the user then selects which among the list he/she wants (one or more values can be selected at once - minimum 1 value).
NOTE: either List Box (Form Control) or List Box (ActiveX Control) depending on what is applicable - no idea at all
2nd Macro:
Use the selected items to copy the rows from the input file then copy to the new file under a certain worksheet name.
-below is the code used to copy data, but needs editing to copy only those that are under the selected criteria from macro 1.
'Copy DBI Balances from DBI Input (based on List - Column AZ of DBI Input file)
Set I_wb_DBI = Application.Workbooks.Open(I_Loc & "\" & "*DBI*.xlsx")
With I_wb_DBI.ActiveSheet
I_DBI_lr = .Cells(.Rows.Count, "B").End(xlUp).Row
I_DBI_lc = .Cells(1, .Columns.Count).End(xlToLeft).Column
'Revise to copy only rows that the value in column AV si selected in the list
.Range(.Cells(1, 1), .Cells(I_DBI_lr, I_DBI_lc)).Copy Destination:=O_ws_DBI.Range("A1")
End With
With O_ws_DBI
.Activate
.Range("A:D").EntireColumn.Delete
.Pictures.Delete
With .Range(.Cells(1, 1), .Cells(1, I_DBI_lc - 4))
.AutoFilter
End With
.UsedRange.Copy
.Cells(1, 1).PasteSpecial Paste:=xlPasteValues
.Range("C2").Select
ActiveWindow.FreezePanes = True
End With
Attached files.
Thank you in advance.
Bookmarks