Macro unhides personal.xls

  • Thread starter Thread starter BillShut
  • Start date Start date
B

BillShut

This is my code, why does the first thing it does is unhide
personal.xls. This code is in a module in personal.xls.

Thanks

Bill

Sub CopyTest()
ActiveWindow.Zoom = 75
Cells.Find(what:="Reference:").Activate
ActiveCell.Offset(0, 1).Select
ActiveCell.Copy
MsgBox "Press the Enter key to continue"
Application.OnKey "~", "'StartSub " & 0 & ",False'"
Cells.Find(what:="Comments:").Activate
ActiveCell.Select
Dim Rng As Range
On Error Resume Next
Set Rng = Application.InputBox(prompt:="Choose A Range", Type:=8)
Rng.Copy
rsp = "onwards"
If rsp = "" Then End
Set foundcell = Cells.Find(what:=rsp)
' Set foundcell = ActiveSheet.Cells.Find(what:="onwards")
If foundcell Is Nothing Then
MsgBox ("Not found")
Else
Application.Goto ActiveSheet.Range("A" & foundcell.Row - 2),
Scroll:=True
ActiveCell.Offset(5, 2).Select
End If
End Sub
 
I didn't put it in my personal.xls file, but I did put it in a hidden workbook.

When I ran it, the workbook stayed hidden.

Could it be in the code you didn't share (StartSub)???
 
Thanks Dave, you put me on the right track. I am a beginner and
"steal" code from forums. I thought that was part of the press enter
on message box. You helped, I commented it out the macro ran fine.

This helps me to learn and your help is appreciated a lot
 
Back
Top