+ Reply to Thread
Results 1 to 5 of 5

Private sub reference a different sheet

  1. #1
    Registered User
    Join Date
    09-08-2018
    Location
    Kamloops, Canada
    MS-Off Ver
    Office 365
    Posts
    86

    Private sub reference a different sheet

    i have code to set a cells value based on the
    Please Login or Register  to view this content.
    as follows
    Please Login or Register  to view this content.
    It works perfectly for staying on the same sheet, but now I want to do something slightly different.

    I want the value set to come from the
    Please Login or Register  to view this content.
    on another sheet. Here's what I have;
    Please Login or Register  to view this content.
    but this doesn't seem to work. Sheet1 is the sheet where the user will be on whatever active row, and I want the value of I4 on the other sheet to be what the value of G"whateverRow" the user is on on Sheet1. Is this doable?

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,377

    Re: Private sub reference a different sheet

    The other way around (put this behind the sheet where the activecell is located).

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Private sub reference a different sheet

    Sheets("other sheet").Range("I4").Value = cells(Target.Row, "G").Value
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    09-08-2018
    Location
    Kamloops, Canada
    MS-Off Ver
    Office 365
    Posts
    86

    Re: Private sub reference a different sheet

    Wonderful. Thank you, JEC.

  5. #5
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,377

    Re: Private sub reference a different sheet

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Two Private Sub() on one sheet
    By PingTing in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2021, 08:00 PM
  2. [SOLVED] Once a sheet is copied to another blank sheet how to delete a private sub checkbox
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2019, 03:59 AM
  3. VBA - 2 Private SUB in one sheet
    By Flashback87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2018, 01:19 PM
  4. [SOLVED] two Private Sub Worksheet_Change in on one sheet
    By MetteGaga in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-28-2015, 06:05 AM
  5. Put Private sub into each new sheet
    By ratdogexcel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2013, 10:26 AM
  6. Calling a Private SUB from SHEET
    By satanovsyn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2011, 08:52 AM
  7. call module sub from sheet private sub
    By tango in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2009, 03:10 AM

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