+ Reply to Thread
Results 1 to 11 of 11

Create MSG Box upon opening a workbook

Hybrid View

timmyjc18 Create MSG Box upon opening a... 06-18-2012, 11:30 PM
MarvinP Re: Create MSG Box upon... 06-19-2012, 12:04 AM
timmyjc18 Re: Create MSG Box upon... 06-19-2012, 12:41 AM
npamcpp Re: Create MSG Box upon... 06-19-2012, 12:09 AM
npamcpp Re: Create MSG Box upon... 06-19-2012, 12:50 AM
timmyjc18 Re: Create MSG Box upon... 06-19-2012, 01:07 AM
npamcpp Re: Create MSG Box upon... 06-19-2012, 02:15 AM
timmyjc18 Re: Create MSG Box upon... 06-19-2012, 02:51 AM
npamcpp Re: Create MSG Box upon... 06-19-2012, 03:00 AM
timmyjc18 Re: Create MSG Box upon... 06-19-2012, 03:12 AM
npamcpp Re: Create MSG Box upon... 06-19-2012, 06:05 AM
  1. #1
    Registered User
    Join Date
    06-14-2012
    Location
    California
    MS-Off Ver
    Office 365
    Posts
    56

    Create MSG Box upon opening a workbook

    I am looking for an easy VBA script that make a MSG box open after opening MS Excel. The user then would have to put in his or her initials, then copy the initials to the next blank row in column A.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,251

    Re: Create MSG Box upon opening a workbook

    Hi,

    See the attached with code behind the workbook. Open it and put in your initials.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    06-14-2012
    Location
    California
    MS-Off Ver
    Office 365
    Posts
    56

    Re: Create MSG Box upon opening a workbook

    How do I get te module to say ThisWorkbook? It is not working for me.

  4. #4
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Create MSG Box upon opening a workbook

    maybe this in the ThisWorkbook module

    Private Sub Workbook_Open()
        initials = InputBox("Enter your initials.")
        Worksheets("Sheet1").Range("A" & Cells(Rows.Count, 1).End(xlUp).Row + 1) = initials
        
    End Sub
    Like a post? Click the star below it!

  5. #5
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Create MSG Box upon opening a workbook

    hit Alt-F11 to open the VB editor. In the left hand navigation you will see a module for each sheet and a module called ThisWorkbook. Double-click that.

  6. #6
    Registered User
    Join Date
    06-14-2012
    Location
    California
    MS-Off Ver
    Office 365
    Posts
    56

    Re: Create MSG Box upon opening a workbook

    I found the Thisworkbook module, but now, my initials are getting put at the very end of the range. I want to have the initials put into the next blank cell in Column A. You are awesome. Thanks for the help so far.

  7. #7
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Create MSG Box upon opening a workbook

    OK. It looks as if column A contains data below the area where you want to put the user initials. Can you tell me what row number that other data starts?

    What will happen if the file gets opened more times than there are blank cells?

  8. #8
    Registered User
    Join Date
    06-14-2012
    Location
    California
    MS-Off Ver
    Office 365
    Posts
    56

    Re: Create MSG Box upon opening a workbook

    I found the problem, but I don't know how to fix it. Column A has formulas for the entire column. Excel is treating them as data. How can I make excel treat them as if they are empty? The row that it is putting the initials in is 6001, which is the the end of my range.

  9. #9
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Create MSG Box upon opening a workbook

    So, what is a formula doing there? You want to have the user initials in column A. Then just remove the formula. Or insert another column before column A to house the user initials.

  10. #10
    Registered User
    Join Date
    06-14-2012
    Location
    California
    MS-Off Ver
    Office 365
    Posts
    56

    Re: Create MSG Box upon opening a workbook

    The formula in Column A is this: =IF(C3="","",A2) When a user inputs a number into a cell in column cell C3, the user initials are copied from cell A2 and put into A3. That way, they don;t have to keep entering there initials every time. If there is a code to do that, along with the msg box to have them enter the initials the first time, that would be awesome.

  11. #11
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Create MSG Box upon opening a workbook

    try this then:

    Private Sub Workbook_Open()
        initials = InputBox("Enter your initials.")
        Worksheets("Sheet1").Range("A" & Cells(Rows.Count, 3).End(xlUp).Row + 1) = initials
        
    End Sub
    This macro looks at column C and finds the next empty row. It will put the user initials into that row, but into column A.

+ 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