Book Edition | 1st Edition |
Author(s) | Freund, Last |
ISBN | 9780357026403 |
Publisher | Cengage Learning |
Subject | Computer Science |
Why did I not begin creating the worksheet in cell A1?
Always Open A Workbook With Each Sheet In Cell A1 Using VBA Code
For example, you always want the workbook to open in cell A1 of every worksheet, regardless of where it was in the workbook when it was last closed. Do the following:
1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window. In the left Project-VBAProject panel, double click ThisWorkbook to open a blank module and then copy and paste the following code into the module, see screenshot:
VBA code: Always open a workbook with each sheet in cell A1:
1
2
3
4
5
| Private Sub Workbook_SheetActivate(ByVal Wsh As Object)
'Updateby Extendoffice
On Error Resume Next
Wsh.Range("A1").Select
End Sub |
2. Then close this code and click File> Save As to save the workbook as macro-enabled Excel workbook format, see screenshot:
3. From now on, when you open this workbook next time, click Available Content to activate the code and switch between sheets, you can see that each worksheet is in cell A1 automatically
Hello what greetings.
Why didn't I start creating the worksheet in cell A1?
Your question is missing information but here is some information that could be of interest to you