Hi,
Please help me to create a button in Excel on which assign a macro with a condition that when I enter column name in cell and press the button then it automatically delete that column.
Thanks in Advance.
Muan
What cell will you be putting the column number into?
' Macro1
i = Range("A2").Value
Range(i & "1").EntireColumn.Delete
End Sub
create the button and asigning the macro is easy to do. The vba should look like this:
Sub macro1()
'
Code:' macro1 i = range("a2").value range(i & "1").entirecolumn.delete end sub
be aware: When entered column a the macro deletes column a including the button!