PDA

View Full Version : [SOLVED] Dynamic Column In Code



decadence
03-29-2016, 07:24 AM
Hi, can someone help me with this code so it can be used on any single column selected rather than just Column B, Thanks



Range("B1:B" & Cells(Rows.Count, "C").End(xlUp).Row).SpecialCells(xlConstants).Offset(, 1).Clear

Paul_Hossler
03-29-2016, 09:08 AM
Not tested, but if you select a cell in any column, it should Clear the column over 1

It'll probably fail if there are no constants in the column



Selection.EntireColumn.Columns(1).SpecialCells(xlConstants).Offset(, 1).Clear

decadence
03-30-2016, 12:56 AM
Thanks Paul, It works perfectly.