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.
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.
Hi,
See the attached with code behind the workbook. Open it and put in your initials.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
How do I get te module to say ThisWorkbook? It is not working for me.
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!
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.
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.
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?
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.
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.
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.
try this then:
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.![]()
Private Sub Workbook_Open() initials = InputBox("Enter your initials.") Worksheets("Sheet1").Range("A" & Cells(Rows.Count, 3).End(xlUp).Row + 1) = initials End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks