Results 1 to 5 of 5

Referencing Worksheet from A Cell

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Referencing Worksheet from A Cell

    Is this possible?

    I have a name of a worksheet in column K.

    Below is a sippet of my code. If I change the part Ptr, "K" to an an actual name of a worksheet the code runs. However, I have the name of a sheet in the cell Ptr, "K" and it doesn't run.

    Please help. Thanks!


    Next Ptr
        If Not RangeToCut Is Nothing Then
            With RangeToCut.EntireRow
                targetRow = Worksheets(Ptr, "K").Cells(Rows.count, "a").End(xlUp).Row

    But this code works...
    Next Ptr
        If Not RangeToCut Is Nothing Then
            With RangeToCut.EntireRow
                targetRow = Worksheets("Monday").Cells(Rows.count, "a").End(xlUp).Row
    Last edited by ScabbyDog; 03-30-2014 at 10:52 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 03-08-2014, 06:16 AM
  2. [SOLVED] Referencing a cell from another worksheet in VBA
    By a-man in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2014, 08:32 AM
  3. Referencing a cell on another worksheet in VBA
    By kthoma85 in forum Excel General
    Replies: 5
    Last Post: 11-30-2013, 03:49 AM
  4. Referencing same cell on different worksheet
    By archipelago in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-05-2008, 10:10 AM
  5. Referencing a cell from another worksheet
    By Mark in forum Excel General
    Replies: 3
    Last Post: 01-27-2006, 05:55 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