Closed Thread
Results 1 to 8 of 8

Need HELP fixing this code

  1. #1
    Registered User
    Join Date
    08-28-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    4

    Exclamation Need HELP fixing this code

    I am trying to macro a code to return a value from a new tab that has just been created.

    This is what I have so far, but it is returning as an error, I know why but I don't know how to resolve the issue.


    ActiveCell.FormulaR1C1 = "=Sheets(ActiveWorkbook.Sheets.Count - 1).Select!R[1]C[4]"

  2. #2
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Need HELP fixing this code

    Hi,

    Try This:

    Please Login or Register  to view this content.


    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  3. #3
    Registered User
    Join Date
    08-28-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    4

    Re: Need HELP fixing this code

    Thanks

    Using that, I have come up with.

    ActiveCell.FormulaR1C1 = "=" & (Sheets.Count - 1) & "!R[45]C[2]"

    This works but it returns the tab number, rather than the tab name.
    Is there a way I can make it return the name?

  4. #4
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Need HELP fixing this code

    Hi,

    Try this code but I have not tested:

    Please Login or Register  to view this content.
    Regards,
    Paresh J

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Need HELP fixing this code

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Registered User
    Join Date
    08-28-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    4

    Re: Need HELP fixing this code

    YAYYYY

    That works perfectly

    Thanks

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Need HELP fixing this code

    Dewbo

    Unfortunately Not a good start here.

    Ignoring Moderator(s) request(s) & giving negative reps will not help you in the future here.

  8. #8
    Registered User
    Join Date
    08-28-2014
    Location
    England
    MS-Off Ver
    2013
    Posts
    4

    Re: Need HELP fixing this code

    Have you even read my post, I have not anticipated a solution at all.
    I was showing what I had so far, and asked for help to fix it.
    Is there a problem with that?

    And I gave you negative rep because your post is warning me against something I did not do.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Fixing worksheet_change code
    By MariPip in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2014, 08:16 PM
  2. [SOLVED] Fixing the VBA code
    By brownie4321 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2012, 09:35 AM
  3. VBA code for Hyperlink fixing
    By narendra1302 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2010, 06:01 AM
  4. [SOLVED] Fixing VBA code to better suit concatenating needs!!
    By Sandwiches2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2006, 10:35 PM
  5. fixing code
    By timmy64 - ExcelForums.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2005, 04:48 AM

Tags for this Thread

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