+ Reply to Thread
Results 1 to 6 of 6

Unsure of correct reference for named range.

  1. #1
    Forum Contributor
    Join Date
    03-04-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    130

    Unsure of correct reference for named range.

    Hi all,

    Thought I had this one sorted but no.

    I'm using a macro to automatically create and send an email after a certain event in a cell.

    The code works fine if im in the sheet and the event is triggered, but if I edit data in a different sheet which then causes the event to trigger the macro the code gets stuck here.

    Please Login or Register  to view this content.
    I have tried a few things, like adding sheetname! in front of the cell references , but soon realised I do not know how to name a range on a specific sheet
    Last edited by JohnDoh; 03-18-2015 at 11:12 AM.

  2. #2
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Unsure of correct reference for named range.

    Do you mean like naming the range of cells from A1:G50 say like "Rawdata" in the name manager under tab Formulas?
    Thank those who have helped you by clicking the Star * below their name and please mark your post [SOLVED] if it has been answered satisfactorily.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Unsure of correct reference for named range.

    John,
    If I understand correctly, your range("A1:G50") needs to be selected on the same sheet regardless of which one is active? have you tried changing
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    NOTE: you need to activate the sheet to select from it, so add "Worksheets("Sheet1").activate" above the line in question if using this method.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Unsure of correct reference for named range.

    Do you mean something like this? Where Sheet1 is the name of the sheet.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-04-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    130

    Re: Unsure of correct reference for named range.

    Sort of, I have just notice I missed a bit in my first description, the macro creates a .pdf file with that range as the print area, so if I'm in another sheet it creates a pdf of the wrong sheet.

    So I guess I'm trying to work out if sheetname!A1:G50 is not the right way to go what should I name it as to pick up the same sheet regardless of whether I'm in the right sheet or not.

  6. #6
    Forum Contributor
    Join Date
    03-04-2013
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    130

    Re: Unsure of correct reference for named range.

    Ignore the last post, was typing it while you lot were busy solving it.

    Thats exactly what I meant.

    Thank you all.

+ 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. Replies: 3
    Last Post: 12-17-2014, 02:05 PM
  2. [SOLVED] Unsure how to fill my Rows with correct COUNTIFS and vlookups
    By dmejia174 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-24-2013, 05:51 AM
  3. Unsure if PivotTable is the correct feature
    By DocReardon in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 06-17-2013, 04:36 PM
  4. Excel 2007 : Unsure of correct table/chart
    By Ahauntingmelody in forum Excel General
    Replies: 0
    Last Post: 08-22-2011, 06:15 PM
  5. Replies: 1
    Last Post: 03-21-2006, 06:40 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