+ Reply to Thread
Results 1 to 7 of 7

Possible to find a cell based on a row header (col A) then a sub-row header (col B)

  1. #1
    Registered User
    Join Date
    12-10-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    10

    Possible to find a cell based on a row header (col A) then a sub-row header (col B)

    Good day all - I'm wondering if it is possible to find a cell based on a row header (Column A), and then a sub-row header (Column B).

    Column A lists a company's name, grouped in twelves because Column B lists the 12 months of the year (so Company ACME is A:1-A-12, Company XYZ, A:13-A:24, and so on)). With VBA, is it possible, for example, to find the cell in Column E, where Column A = ACME Company and Column B = March?

    Ultimately, I'd like to write a sub that automatically pastes data from another sheet to these cells if this is possible.

    Thank you for the time.
    Last edited by lifeboat; 12-14-2011 at 09:04 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Possible to find a cell based on a row header (col A) then a sub-row header (col

    Yes, its possible using VBA.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Possible to find a cell based on a row header (col A) then a sub-row header (col

    assuming the company names begin at A2 and month names begin at B2 (A1 and B1 contain title), and you put the company name that you want to find in cell D1 and the month name that you want to find in E1,, try this:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-10-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Possible to find a cell based on a row header (col A) then a sub-row header (col

    Thank you, mohd9876, I will give that a shot.

  5. #5
    Registered User
    Join Date
    12-10-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Possible to find a cell based on a row header (col A) then a sub-row header (col

    mohd9876: I've played around with the suggestion you have provided, but I can't get it to work. I've replaced the cell references with variables, and it throws an error (Method 'Range' of object '_Global' failed).

    Please Login or Register  to view this content.
    Specifically, I am trying to paste the data in a variable (InvData) to the cell in column H, where column A = the company (variable "currComp") and column B = (variable "currMonth")

    I probably should have been more specific from the beginning - apologies. Any ideas?

  6. #6
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Possible to find a cell based on a row header (col A) then a sub-row header (col

    well, it works for me, could you post your workbook and ill see what the problem may be

  7. #7
    Registered User
    Join Date
    12-10-2011
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Possible to find a cell based on a row header (col A) then a sub-row header (col

    mohd9876 - Thanks for the prompt reply. I think I have it working now. I was passing in the variable incorrectly. I now have it written as below and it seems to be working just fine in the mockup sheet.
    Please Login or Register  to view this content.
    Many thanks!

+ 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