+ Reply to Thread
Results 1 to 6 of 6

VBA Header

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    33

    VBA Header

    Just a curiosity, but is there a way to 'automate' the header within a spreadsheet. I have a spreadsheet used as a pricing document, which means that each time its used for a different project. Often because more than one person uses it, the previous projects title name is left in the header. I was wondering if there is a way for a popup form or msgbox type item to appear once the file is opened, prompting the user to type the project name into it (to be entered into the header) before they can proceed to use the spreadsheet.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA Header

    Your suggestion is possible. However, wouldnt the users be opening the file maybe to reference it or to edit it? Do you want the msgbox to popup at that time too?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: VBA Header

    Try a variation on the following with your input value:
    Please Login or Register  to view this content.
    You can also populate left and right header sections with

    Please Login or Register  to view this content.
    Last edited by barryleajo; 02-04-2013 at 11:22 AM.
    If this was helpful then please click the small star icon at the bottom left of my post. A little appreciation goes a long way.

  4. #4
    Registered User
    Join Date
    01-30-2013
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: VBA Header

    Thats a very good point that I had overlooked arlu, but in the majority of case 98% once a quote has been done its not edited at least not after the first instance of the file being opened, so I dont think it would be a major problem. Barryleajo, your suggestion seems to populate the header, but to make this a variable string based on input, would I need to do hdrstr = Application.InputBox(prompt := "Project Reference", type := 8)

  5. #5
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: VBA Header

    Any valid and convenient means to get your requirement into the variable hdrstr (in my example) would do.

    I think type:=8 requires the input to be obtained from a cell reference. If you wanted the user to enter it directly then something like the following would do:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-30-2013
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: VBA Header

    I think I need more practice with the basics! Thanks for the help, I would have been pondering over that for quite some time.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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