+ Reply to Thread
Results 1 to 12 of 12

Coding for offset cell references with multiple row headings with merged cells

  1. #1
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Coding for offset cell references with multiple row headings with merged cells

    Hi

    I understand how to code to specify a cell in which to enter data into a spreadhseet, when the heading contains only one row.

    In the attached example the headings contain multiple rows with merged cells, is there any way of overcoming this so that the entries are placed in the correct cells?

    Many thanks.

    Andy
    Attached Files Attached Files
    Last edited by AndyE; 01-04-2010 at 02:32 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Coding for offset cell references with multiple row headings with merged cells

    It'sbest to avoid Merged Cells completely. Your code would be easier if you didn't have empty columns as well

    Change your Submit code to this
    Please Login or Register  to view this content.
    Last edited by royUK; 01-04-2010 at 01:02 PM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    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: Coding for offset cell references with multiple row headings with merged cells

    Hello Andy,

    I have your workbook open. Can you give me an example of what the problem is?
    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!)

  4. #4
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Coding for offset cell references with multiple row headings with merged cells

    Leith

    If you open the form and click submit you will find that the values entered will be placed in various columns across Row 4, rather than in the order A4, B4, C4 etc.

    Thanks,

    Andy

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Coding for offset cell references with multiple row headings with merged cells

    Have you checked the code that I posted?

  6. #6
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Coding for offset cell references with multiple row headings with merged cells

    Yes I have Roy, sorry I replied for the benefit of Leigh & hadn't read the code at that time.

    I've tried it and it works a peach except that it begins entering the data on Row 18 for some reason.....any ideas?

  7. #7
    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: Coding for offset cell references with multiple row headings with merged cells

    Hello AndyE,

    I revised your macro after I figured out what you wanted to do. This macro has been added to the user form in the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Coding for offset cell references with multiple row headings with merged cells

    Quote Originally Posted by AndyE View Post
    Yes I have Roy, sorry I replied for the benefit of Leigh & hadn't read the code at that time.

    I've tried it and it works a peach except that it begins entering the data on Row 18 for some reason.....any ideas?
    It shouldn't,it posted to Row 4 in your example

  9. #9
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Coding for offset cell references with multiple row headings with merged cells

    I figuered out the starting point in Row 18...just me being addtitionally thick....

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Coding for offset cell references with multiple row headings with merged cells

    Quote Originally Posted by AndyE View Post
    I figuered out the starting point in Row 18...just me being addtitionally thick....
    What was it?

  11. #11
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Coding for offset cell references with multiple row headings with merged cells

    The copy of the sheet I attached had formula in rows 1-17, where I had been playing around with different ways of trying to achieve what you solved for me.

    The code was of course recognising that these rows were occupied and were locating the next available one in order to enter the data.

    Cheers....sorry!

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Coding for offset cell references with multiple row headings with merged cells

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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