dcsimg
Results 1 to 5 of 5
  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,018

    Resolved [RESOLVED] Automatically change column reference in VBA code

    I have a situation where I have a workbook with columns from "A" to "HZ" and more than a dozen macros that refer to various columns, and I would like to delete 30 non-contiguous columns. Obviously if I delete column "C" (for example) any code that refers to "Q" (for example) will now have to be changed to refer "P" and if I then delete column "E", that same code nw needs to refer to "O". Another complication is that code that refers to columns at the end of the sheet will be effected more than those at the beginning.

    I'm comfortable editing code in the VBIDE, but doing it for the above manually will for me at least be a very error-prone nightmare. Has anyone done anything like this or know of any tool or add-in that would automate it?

  2. #2

  3. #3
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,481

    Re: [RESOLVED] Automatically change column reference in VBA code

    Or you could delete from right to left instead.

  4. #4

  5. #5
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,481

    Re: [RESOLVED] Automatically change column reference in VBA code

    Ah, gotcha.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.