lynnnow
02-14-2013, 10:24 PM
I'm completely stumped why the Range.Find will find the data on the first run and then fail subsequently, needing me to close Excel and restart the application. I get a 1004 error. I've attached the workbook for same.
The macro is initiated with Ctrl+L. There are two userforms in the file, but I'm working on UserForm2. UserForm1 is my old code that works fine. I needed to upgrade and hence the effort.
I have used a spreadsheet control that uses data from another sheet to only display the data on the form. The .Find function has to look for a date (from Textbox1) and return the column number and the ActiveCell's row is used in an Intersect function to get the coordinates for the first cell, then I use the .Find function to get the last cell in a similar way and get those coordinates. This works superbly for the first run of the macro. I've made the userform reload after the entry is saved until I close the userform.
I'm at a loss to understand why the .Find function doesn't return a range on the second run. :help
Any hints and suggestions on what I could improve are also appreciated.
I'm using Win XP and Office 2003 to test at work and Win 7 and Office 2010 at home to test.
The macro is initiated with Ctrl+L. There are two userforms in the file, but I'm working on UserForm2. UserForm1 is my old code that works fine. I needed to upgrade and hence the effort.
I have used a spreadsheet control that uses data from another sheet to only display the data on the form. The .Find function has to look for a date (from Textbox1) and return the column number and the ActiveCell's row is used in an Intersect function to get the coordinates for the first cell, then I use the .Find function to get the last cell in a similar way and get those coordinates. This works superbly for the first run of the macro. I've made the userform reload after the entry is saved until I close the userform.
I'm at a loss to understand why the .Find function doesn't return a range on the second run. :help
Any hints and suggestions on what I could improve are also appreciated.
I'm using Win XP and Office 2003 to test at work and Win 7 and Office 2010 at home to test.