+ Reply to Thread
Results 1 to 13 of 13

Worksheets

  1. #1
    Registered User
    Join Date
    10-07-2009
    Location
    Brisbane Australia
    MS-Off Ver
    Excel 2003
    Posts
    13

    Worksheets

    I have an excel spreadsheet consisting of 2 sheets (Request Form & Request History). I have a button on the first one that when I press it I want it to save all the details on the 2nd one in plain columns but I am having problems referencing both at same time. In My code I have the following:
    Please Login or Register  to view this content.
    Now when I type SheetTo for example then follow it with the . notation it comes up with the action linked to a worksheet but when I try that with SheetFrom and hit the . it shows nothing and I cant refer to it at all. Can anyone help? I am trying to automate forms used where I work and this is halting my progress.

    You will have to excuse filenames for attachments they are back to front, but these are screen shots of what I mean tho.
    Attached Images Attached Images
    Last edited by Leith Ross; 10-07-2009 at 07:43 PM. Reason: Added Code Tags

  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,259

    Re: Worksheets

    Hello Programmin'Pete,

    To assign an object variable to an object, you need to use the Set statement.
    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
    Registered User
    Join Date
    10-07-2009
    Location
    Brisbane Australia
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Worksheets

    This is the code I have now based on the changes you suggested, but still when I go to, on line after the set commands and try to use both
    SheetTo. or SheetFrom. only one of them comes up with the list box with the fields for a worksheet. The rest of the code was to determine the next unused row for the data to be saved into


    Please Login or Register  to view this content.
    Last edited by Leith Ross; 10-07-2009 at 09:22 PM. Reason: Added Code Tags - OP doesn't know how.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Worksheets

    Pete,

    Please take a few minutes to read the forum riules, and then edit your post to add code tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    10-07-2009
    Location
    Brisbane Australia
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Worksheets

    Tried what u suggested and still when I type SheetTo. the drop down box doesnt show.

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

    Re: Worksheets

    Hello Programmin'Pete,

    Post your workbook and I'll review it.

    To make your posts easier to read, copy, and edit please wrap your code.

    How to wrap your Code
    1. Select all your code using the mouse.
    2. Click on the # icon on the toolbar in the Message window. This will automatically wrap the text you selected with the proper Code tags to create a Code Window in your post.

    Use the Bulletin Board Code Tags
    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] at the end of the last line.


    To learn more about BB codes used in this forum, just click on the link below...

    Bulletin Board Codes Tags

  7. #7
    Registered User
    Join Date
    10-07-2009
    Location
    Brisbane Australia
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Worksheets

    Here is the spreadsheet. I have wracked my brain on this and there has got to be something I am missing. just seems weird that out of the two worksheet reference variables one refers to the worksheet and other doesnt.
    Attached Files Attached Files

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

    Re: Worksheets

    Hello Programmin'Pete,

    You posted an Excel 2007 worksheet. I don't Excel 2007 (see my profile - to the right of my name). You will need to post a copy in Excel 2003 format before I can help you.

  9. #9
    Registered User
    Join Date
    10-07-2009
    Location
    Brisbane Australia
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Worksheets

    Sorry about that, new to forum and didnt think to check your profile. Converted it as per excel to "Excel 97-2003" format
    Attached Files Attached Files

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

    Re: Worksheets

    Hello Programmin'Pete,

    Here is the updated macro. It has been added to the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: Worksheets

    Hello Programmin'Pete,

    Here's an update to the macro. I caught an error in the NextRow calculation.
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    10-07-2009
    Location
    Brisbane Australia
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Worksheets

    Thanks for the help, atm being in a call centre that I am using this spreadsheet for I am flat chat. will slot that code in and give it a whirl as soon as i can.

  13. #13
    Registered User
    Join Date
    10-07-2009
    Location
    Brisbane Australia
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Worksheets

    Thanks for that code, just had chance to place it into macro and works great. And looking at it a few time and I understand what is going on, alot cleaner code than before......

+ 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