ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to erase a column VBA (https://www.excelbanter.com/excel-discussion-misc-queries/150356-how-erase-column-vba.html)

Jepane

How to erase a column VBA
 
Hi,

Im trying to erase a column via VBA, this column is variable and depends on
the active cell,
Im trying this but obviously its not working:

ActiveSheet.Columns(ActiveCell).Delete

Any kinda help will be very appreciated

Thx

Jepane

Gary''s Student

How to erase a column VBA
 
Sub demo()
ActiveCell.EntireColumn.Delete
End Sub

--
Gary''s Student - gsnu200734


"Jepane" wrote:

Hi,

Im trying to erase a column via VBA, this column is variable and depends on
the active cell,
Im trying this but obviously its not working:

ActiveSheet.Columns(ActiveCell).Delete

Any kinda help will be very appreciated

Thx

Jepane


Jepane

How to erase a column VBA
 
Thanx a lot Gary, i guess it was trivial, but helps me a lot


"Gary''s Student" wrote:

Sub demo()
ActiveCell.EntireColumn.Delete
End Sub

--
Gary''s Student - gsnu200734


"Jepane" wrote:

Hi,

Im trying to erase a column via VBA, this column is variable and depends on
the active cell,
Im trying this but obviously its not working:

ActiveSheet.Columns(ActiveCell).Delete

Any kinda help will be very appreciated

Thx

Jepane



All times are GMT +1. The time now is 08:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com