+ Reply to Thread
Results 1 to 3 of 3

Selecting an entire column using a reference defined in another cell

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Tamworth, Australia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Selecting an entire column using a reference defined in another cell

    Hi, all. I'm very new to VBA and Macros so apologies in advance for this simple question.

    I need to highlight an entire column to the right of the Active Cell. How far to the right is defined by a number in A2. I had considered using the following:

    Please Login or Register  to view this content.
    whereas x = a number contained in A2.

    What do I substitute here for the x, or is there another way?

    Many thanks in advance.

    Darren
    Last edited by Pippin66; 10-18-2012 at 09:05 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Selecting an entire column using a reference defined in another cell

    Hi, Darren,

    maybe start with something like
    Please Login or Register  to view this content.
    but I´d like to express that most of the time it´s unnecessary to Select or Activate as whatever action is wanted to take place in almost all cases may be done without these commands.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    10-18-2012
    Location
    Tamworth, Australia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Selecting an entire column using a reference defined in another cell

    Wonderful! Thank you, Holger.

    This code did exactly as I needed (I had attempted something similar but omitted ".Value".

    And thanks also for the advice... I am totally new to VBA and learning as I go!

    Darren

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1