-
Jul 25th, 2014, 08:39 PM
#1
Thread Starter
New Member
[RESOLVED] excel data entering on previous sheet
Recently, my company upgraded some of its PC's to office 2013.
One of my spreadsheets, which ran fine on the PC's with office 2007/2010 will not run properly on 2013.
The file has a "Summary" sheet with some buttons on.
When you click a button, it first shows a userform, where the user enters data a couple of text boxes, then clicks the button on the userform. This unhides another worksheet "Spill Kit", for the user to work on.
The issues is that when the "Spill Kit" is unhidden, although it is visible on the screen, and is the activesheet (when I use msgbox(activesheet.name) in the VBE immediate window, it gives "Spill Kit"), when I type into the new sheet, the data is actually entered on the "Summary" sheet.
I have removed all code from the sheets, and stripped out as much of the code on the userform button as possible, but I still get the same result.
If I manually change pages back to Summary and then return to Spill Kit, I am then typing on the "Spill Kit" page.
The remaining code on the userform button is:
Code:
Sub spillkitstart_Click()
'Application.ScreenUpdating = False
ThisWorkbook.Sheets("Spill Kit").Visible = xlSheetVisible
'ThisWorkbook.Sheets("Spill Kit").Unprotect
'Sheets("Spill Kit").Range("c3") = CDate(SpillKitDate)
'Sheets("Spill Kit").Range("c2").Value = SpillKitBy.Value
Unload Me
ThisWorkbook.Sheets("Spill Kit").Select 'or .activate ??
'ThisWorkbook.Sheets("Spill Kit").Range("a1").Select
'ThisWorkbook.Sheets("spill kit").PrintOut
'ThisWorkbook.Sheets("Spill Kit").Protect
MsgBox ("A blank order form has printed." & vbCr & "Use this to record your stocktake of the Spill Kit" & vbCr & "Then return to the computer to input the stocktake and send."), , "Spill Kit Checklist"
'Application.ScreenUpdating = True
End Sub
Anyone have ideas why this would be?
Thanks!
-
Jul 28th, 2014, 04:51 AM
#2
Thread Starter
New Member
Re: excel data entering on previous sheet
Turns out it was just the order of the lines of code. Unloading the userform last made it work.
Code:
Sub spillkitstart_Click()
Application.ScreenUpdating = False
'do all your stuff here
Unload Me
'don't do any more stuff here
Application.ScreenUpdating = True
End sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|