Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

problem addressing columns

  Asked By: Hayfa    Date: Nov 01    Category: MS Office    Views: 523
  

My macro has different options to customize a report. Since the layout changes
occasionally I define the columns as numeric constants (=Column number) Thus if
the report layout changes, I only need to re-define the constants and the rest
off my macro works automatically, rather than changing all the code. Everything
works perfect, but...

Deleting entire column blocks gives me some headache. Sure,
Columns("AM:AO").Delete works perfect. However as said, I have the columns as
numbers.
I do not want to delete columns one by one,, since this significantly would
lengthen my code.
I tried Columns(Tx3C & ":" & Tx6C).Delete which does not work.
Converting the numbers into characters like Columns(Chr(64 + Tx3C) & ":" &
Chr(64 + Tx6C)).Delete does not work, because my table far exceeds 26 columns.
I can' define the constants as letters, since I loops through the rows keeping
column fix, like: cells (n, Tx3C) = [whatever code is needed]

What is the correct syntax for
Columns(Tx3C & ":" & Tx6C).Delete

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on problem addressing columns Or get search suggestion and latest updates.




Tagged: