Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Apr 27, 2:03*pm, JLatham wrote:
Also, remember that once you do open the Master book, it's going to become the active workbook, and your Range("A" & lastRow).Value=Now statement is going to take affect on the active sheet in the Master workbook unless you re-activate "ThisWorkbook" or specify the sheet in ThisWorkbook to write that value to, as ThisWorkbook.Activate Range("A" & LastRow).Value = Now or ThisWorkbook.Worksheets("somesheetname").Range("A" & LastRow).Value = Now "jlclyde" wrote: I am trying to open a file from a userForm....When stepping through the code; when it gets to the FileNm part where it sets the Files name to open, it runs to the end. *I am pretty sure this is not normal. How do I get this back to where I can step through line by line with F8? *Code is below. Thanks, Jay Private Sub Enter_Click() * * Dim LastRow As Long * * Dim FileNm As String * * Dim Master As Workbook * * ChDir "G:\Masters\" * * LastRow = Range("A65536").End(xlUp).Row + 1 * * FileNm = Application.GetOpenFilename(Title:="Please choose a file to import.", MultiSelect:=False) * * Set Master = Workbooks.Open(Filename:=FileNm, ReadOnly:=True) * * With Master.Sheets(1) * * End With * * Range("A" & LastRow).Value = Now * * Unload Me End Sub .- Hide quoted text - - Show quoted text - I fully inderstand what you are gettign at...I just have no idea why it is doing this. It just started doing this today. I use to be bale to step through line by line even when opening a workbook. Now for some reason it just takes off and finishes the macro. I do not want to have to set my whole code as breaks to step through it. Thanks for trying, Jay |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open Last Modified File form Location | Excel Discussion (Misc queries) | |||
How can I open excel template form in a shared file using vista? | Excel Discussion (Misc queries) | |||
Open Form when file opened | Excel Discussion (Misc queries) | |||
Open Form Automatically in Excel File | New Users to Excel | |||
Create a form to open a comma delimited file | Excel Discussion (Misc queries) |