I have reference data in columns A and B on Sheet2 of my WorkBook
. I have a blank sheet - Sheet1 - which i need to fill from my database.
I want to use Excel VBA to fill Sheet1 based on data in columns A and B in Sheet2 .
I use the reference data by.
ThisWorkbook
, right click it, and select View Code . Workbook
from the list. This should give you the following
Private Sub Workbook_Open()
End Sub
This is the event that is fired each time the work book is opened. Now you will need to add code to reference the sheets in the workbook.
Here is some methods for how to reference sheets in vba Reference sheets . Next step will be to refer to the cells in the sheets see - > excel ranges as an example.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.