+ Reply to Thread
Results 1 to 3 of 3

Locating and selecting a column with VB Script

  1. #1
    Registered User
    Join Date
    04-20-2005
    Posts
    24

    Locating and selecting a column with VB Script

    Gooday,

    I’m trying to program a large macro and part of the macro involves locating columns by there header and moving them to a different worksheet. This needs to be done because the columns can be provided in different order.

    How would I go about locating a column and then selecting it using VB.?

    Example column name: “Vendor”

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764
    Hi
    The answer depends on how you want to use the info obtained.
    if row 1 has header, =match("Vendor",A1:R1,0) returns the column number where vendor is located.
    Ravi

  3. #3
    Registered User
    Join Date
    04-20-2005
    Posts
    24
    Quote Originally Posted by ravishankar
    Hi
    The answer depends on how you want to use the info obtained.
    if row 1 has header, =match("Vendor",A1:R1,0) returns the column number where vendor is located.
    Ravi

    That's not a VB script and that only indicates the position in the array; It does not select the column. I need to select the column so that I may move the entire column to an other worksheet

+ 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