![]() |
Position to first empty cell upon program open
I have a workbook for data entry which contains many rows of data. I want my
cursor/selection to automatically position to the first applicable empty row in Column A when I open this workbook. It currently positions to A81. Is this the default, or can I change it? Is there a way to do this? -- Savannah |
Position to first empty cell upon program open
Include the following macro in the worksheet event code area:
Private Sub Worksheet_Activate() n = Cells(Rows.Count, "A").End(xlUp).Row Cells(n, "A").Select End Sub Because it is worksheet code, it is very easy to install and use: 1. right-click the tab name near the bottom of the window 2. select View Code - this brings up a VBE window 3. paste the stuff in and close the VBE window If you save the workbook, the macro will be saved with it. To remove the macro: 1. bring up the VBE windows as above 2. clear the code out 3. close the VBE window To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm To learn more about Event Macros (worksheet code), see: http://www.mvps.org/dmcritchie/excel/event.htm -- Gary''s Student - gsnu200810 "Savannah" wrote: I have a workbook for data entry which contains many rows of data. I want my cursor/selection to automatically position to the first applicable empty row in Column A when I open this workbook. It currently positions to A81. Is this the default, or can I change it? Is there a way to do this? -- Savannah |
Position to first empty cell upon program open
I tried that, but I am not able to edit the macro... I get an error message
that says, "Project locked--project unavailable". -- Savannah "Gary''s Student" wrote: Include the following macro in the worksheet event code area: Private Sub Worksheet_Activate() n = Cells(Rows.Count, "A").End(xlUp).Row Cells(n, "A").Select End Sub Because it is worksheet code, it is very easy to install and use: 1. right-click the tab name near the bottom of the window 2. select View Code - this brings up a VBE window 3. paste the stuff in and close the VBE window If you save the workbook, the macro will be saved with it. To remove the macro: 1. bring up the VBE windows as above 2. clear the code out 3. close the VBE window To learn more about macros in general, see: http://www.mvps.org/dmcritchie/excel/getstarted.htm To learn more about Event Macros (worksheet code), see: http://www.mvps.org/dmcritchie/excel/event.htm -- Gary''s Student - gsnu200810 "Savannah" wrote: I have a workbook for data entry which contains many rows of data. I want my cursor/selection to automatically position to the first applicable empty row in Column A when I open this workbook. It currently positions to A81. Is this the default, or can I change it? Is there a way to do this? -- Savannah |
Position to first empty cell upon program open
This will occur if your workbook is shared under ToolsShare Workbook.
Unshare to add the code. Re-share after if necessary. The code will run. Gord Dibben MS Excel MVP On Mon, 27 Oct 2008 07:56:02 -0700, Savannah wrote: I tried that, but I am not able to edit the macro... I get an error message that says, "Project locked--project unavailable". |
Position to first empty cell upon program open
Thank you for your help. I unshared the workbook and added the code, but now
I get an security warning every time I open the workbook saying that the macro has been disabled because it may contain a virus. I chose "Enable content", but the message keeps coming up. -- Savannah "Gord Dibben" wrote: This will occur if your workbook is shared under ToolsShare Workbook. Unshare to add the code. Re-share after if necessary. The code will run. Gord Dibben MS Excel MVP On Mon, 27 Oct 2008 07:56:02 -0700, Savannah wrote: I tried that, but I am not able to edit the macro... I get an error message that says, "Project locked--project unavailable". |
Position to first empty cell upon program open
If your macro security is set to medium you will get the message about
disabling or enabling macros. When you open the workbook click on "Enable Macros" to have the code run. If you don't want to see the message you can set security to "low".......not recommended...............or create a digital signature using MS Office Tools SelfCert application. Gord On Mon, 27 Oct 2008 10:12:12 -0700, Savannah wrote: Thank you for your help. I unshared the workbook and added the code, but now I get an security warning every time I open the workbook saying that the macro has been disabled because it may contain a virus. I chose "Enable content", but the message keeps coming up. |
All times are GMT +1. The time now is 07:03 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com