I know that the function Columns("C:C") can be used to delete a column, but what if I want to use a variable in place of the "C:C". I tried replacing C with the variable (integer) but it didnt work.
I know that the function Columns("C:C") can be used to delete a column, but what if I want to use a variable in place of the "C:C". I tried replacing C with the variable (integer) but it didnt work.
Something like
Option Explicit Sub DeleteColumn(Col As Long) ActiveSheet.Columns(Col).Delete End Sub Sub DoIt() 'run this to delete Column C DeleteColumn 3 End Sub
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Did this solve your problem? If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks