+ Reply to Thread
Results 1 to 3 of 3

With function reference worksheet from cell value

  1. #1
    Registered User
    Join Date
    11-09-2010
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    21

    With function reference worksheet from cell value

    I am in the middle of writing some code to update Timesheets of employees from a "MASTER" sheet which has a simple table: employee names in Left Column, Current Date, Project Site Reference, Start Time, Break, Finish Time.

    When I come to use the With function, I want to reference the worksheet name according to the employees name recorded in the Left hand column of my master table. I get an object error here.

    I am sure the solution is simple but I am becoming frustrated at the amount of time spent trying to figure it out.

    So far, to simplify the code construction, I am only working on one employee name.

    I have only a basic understanding of code and any help will be much appreciated.

    CODE:

    Please Login or Register  to view this content.
    Last edited by nickypatterson; 01-22-2011 at 08:51 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: With function reference worksheet from cell value

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    STAFF1 is a variant holding the name of the sheet rather than a reference to the worksheet so try

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-09-2010
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: With function reference worksheet from cell value

    Quote Originally Posted by Andy Pope View Post

    STAFF1 is a variant holding the name of the sheet rather than a reference to the worksheet so try

    Please Login or Register  to view this content.
    Perfect - thank you very much Andy!

    And I have noted the remark regarding code.

    Have a good weekend. Nicky

+ 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