In the previous template, we were finding the last used column according to the first row of columns. The used code that to find last used column :
"lst_column = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column"
Any value in the first row may not always be . Values may be in bottom rows.Therefore, we created the following code to find last used column in this template :
"lst_column = ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Column"