Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting Data from a worksheet to a form - and back again
Hello,
I am new to VBA (Excel 2007), and am struggling with the syntax to get data from a form into a worksheet. The scenario: 1. The 'Contacts' worksheet contains customer contacts - name, address, phone, etc. The user scrolls around, looking for someone to call. When they find one, 2. Run a macro that calls a module to pull the current row's data into a form. This is working. 3. Add contact info (e.g. who you talked to, date/time, notes) to the form; then 4. Click the 'AddContact' command button on the form, which will 5. Add a new row to the 'Contacts' worksheet, with the data collected on the form. Steps 1-3 are working. Step 2 has code like this: Selection.Font.Bold = True ' Get the data from the spreadsheet to the form ContactForm.Company = Cells(ActiveCell.Row, 2) ContactForm.Contact = Cells(ActiveCell.Row, 4) ContactForm.Address = Cells(ActiveCell.Row, 5) ... ContactForm.AttemptName = Cells(ActiveCell.Row, 4) ContactForm.AttemptDate = Date ContactForm.AttemptTime = Time ContactForm.AttemptPhone = Cells(ActiveCell.Row, 11) ContactForm.Show I am struggling with the syntax to pull the data from the form into the spreadsheet (via the on_click event in the command button). Where can I go to find syntax examples? Thanks in advance, --Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Write data back from a form to sheet | Excel Discussion (Misc queries) | |||
Data back to Form??? | Excel Programming | |||
Passing data back from a form | Excel Programming | |||
Passing data back from a form | Excel Programming | |||
Passing data back from a form | Excel Programming |