+ Reply to Thread
Results 1 to 5 of 5

Help with a Formula to Print a stored variable

  1. #1
    Forum Contributor
    Join Date
    05-16-2007
    Location
    USA
    MS-Off Ver
    MS Office 2016, Excel 2016
    Posts
    214

    Help with a Formula to Print a stored variable

    Hey guys quick question for the experts here.

    Is there a feature like the 'Print' feature back in BASIC programming days?

    I'm trying to keep up with my taxes each year using Excel 2010, and I have named my sheets Taxes 2010, Taxes 2011, etc. at the bottom. Also each sheet or work book (I think is what you call it), the actual data on the page starts with a title at the top, PROPERTY TAXES "Year", then followed by all my nasty tax data. So anyways I would like to add the sheet name that is at the bottom to the title at the top of all my sheets\ workbooks.

    EX: Print "PROPERTY " ; Sheet 1

    Sheet 1 = TAXES 2010

    So it would read, PROPERTY TAXES 2010

    I could do that simply in BASIC, but how do I make this work in excel? I don't even see a PRINT command but then again I have much to learn and I'm excited yet overwhelmed with all that is possible in excel.

    Thanks guys, and if you know a good tutorial page for getting started with basic commands in Excel point me to it. I don't want to just ask questions all the time, I want to learn as much as I can.


    Can this not be done in Excel?
    Last edited by Modify_inc; 12-07-2010 at 05:51 PM.

  2. #2
    Forum Contributor
    Join Date
    05-16-2007
    Location
    USA
    MS-Off Ver
    MS Office 2016, Excel 2016
    Posts
    214

    Re: Help with a Formula to Print a stored variable

    Seriously no suggestions or input on this. Did I post in the wrong section? Based on what I have read and seen in this forum this should be a drop in the bucket for some of you guys!

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Help with a Formula to Print a stored variable

    If I understand you correctly
    ="PROPERTY " & =MID(CELL("Filename",A1),SEARCH("]",CELL("filename",A1))+1,50)

    Does that work?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor
    Join Date
    05-16-2007
    Location
    USA
    MS-Off Ver
    MS Office 2016, Excel 2016
    Posts
    214

    Re: Help with a Formula to Print a stored variable

    Quote Originally Posted by ChemistB View Post
    If I understand you correctly
    ="PROPERTY " & =MID(CELL("Filename",A1),SEARCH("]",CELL("filename",A1))+1,50)

    Does that work?
    Incredibly it does, minus a small error, but Excel corrected it. Looks like the = before MID was not needed.

    ="PROPERTY "&MID(CELL("Filename",A1),SEARCH("]",CELL("filename",A1))+1,50)

    So the MID function extracts a string from a location and the SEARCH function specifies where to find a string location. What does the rest of this formula do, do you mind breaking it down?

    Thanks again!

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Help with a Formula to Print a stored variable

    ="PROPERTY " & =MID(CELL("Filename",A1),SEARCH("]",CELL("filename",A1))+1,50)

    CELL("Filename",A1) returns the complete path to the file including workbook name (file) and sheet name.
    =MID (what to look at, where to start looking, how many characters to return)
    so
    Look at the file path-name,
    Start looking at character number (whereever it finds the "]" + 1. The "Book" name which always precedes the sheet name is bracketed in [ ].
    return the next 50 characters.(I figured that would be enough)
    Does that help?

+ 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