+ Reply to Thread
Results 1 to 4 of 4

relate row numbers to column numbers

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    Southport, England
    MS-Off Ver
    Excel 2011(for mac)
    Posts
    28

    relate row numbers to column numbers

    I have a list in a column, rows 1 to 5 with each cell containing text. When the text I'm looking for is found I want to make the row number to relate to a column number as follows
    Row 1 relates to column 3
    Row 2 relates to column 5
    Row 3 relates to column 7
    Row 4 relates to column 9
    Row 5 relates to column 11

    How can this be achieved in vba?

    many thanks in anticipation

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: relate row numbers to column numbers

    Hello DPJW,

    This is a simple arithmetic progression which can be define as (row* 2) + 1. You can search for the text in the range using the Find method.

    For example, say your range is "A1:A5". The following code will display the column number in a message box when found.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: relate row numbers to column numbers

    @ Leith Ross,

    I like! Nice short neat and clean.

    Kind Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Registered User
    Join Date
    09-04-2013
    Location
    Southport, England
    MS-Off Ver
    Excel 2011(for mac)
    Posts
    28

    Re: relate row numbers to column numbers

    Thanks that is just what I was looking for. I was thinking of using Ifs but this is so much better. I was also having problems getting to an arithmetic sequence.
    So thank you

    Best regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Insert row numbers into column A, reflect correct row numbers when I add or delete rows
    By jcambell in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2015, 02:18 PM
  2. Replies: 1
    Last Post: 05-14-2015, 09:27 AM
  3. Replies: 4
    Last Post: 05-08-2014, 09:43 PM
  4. [SOLVED] Getting Excel 2007 to list the cell numbers of the top five ranked numbers in a column.
    By Securitysports in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2013, 11:42 AM
  5. Replies: 2
    Last Post: 05-15-2013, 11:08 PM
  6. Convert numbers to relate to a folder/file name
    By sam71 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2011, 08:59 AM
  7. Replies: 1
    Last Post: 07-19-2010, 12:03 PM

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