LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Sending data to a different workbook

Even though I'm pretty new at Visual Basic and basically
just cut and pasted a lot from different internet sites, I
think my form's pretty close to working. I can get it to
write to a different workbook, or write on the next blank
line in the same workbook, but I'm struggling trying to
figure out how to take data from the fields and put them
into the next empty row in a different workbook. So far I
have:

Private Sub btnSubmit_Click()
Dim appExcel As Excel.Application
Dim LastRow As Object
Set appExcel = New Excel.Application
appExcel.DisplayAlerts = False
appExcel.Visible = False
appExcel.ScreenUpdating = False
appExcel.Workbooks.Open FileName:="C:\my
documents\Sales Rep leads\Master List.xls"
appExcel.Worksheets("List").Select
*******appExcel.Range("a65536").End (xlUp)*******
appExcel.Offset(1, 0).Value = txtContactName.Text
appExcel.Offset(1, 1).Value = txtLocation.Text
appExcel.Offset(1, 2).Value = txtCompanyName.Text
appExcel.Offset(1, 3).Value = txtCity.Text
appExcel.Offset(1, 4).Value = txtState.Text
appExcel.Offset(1, 5).Value = txtPhoneNumber.Text
appExcel.Offset(1, 6).Value = txtContactName.Text
appExcel.Offset(1, 7).Value = txtNotes.Text
appExcel.ActiveWorkbook.Close Savechanges:=True
appExcel.Quit
Set appExcel = Nothing
Unload Me
End Sub


I'm pretty confident that my problem is in the line with
the astericks, but I'm not exactly sure how to fix it.
Like I said, this is a lot of cutting and pasting, but I
do want to learn so whatever you could explain to me (both
how to fix it and what it is that I've actually done in
this whole program), would be greatly appreciated. Thanks.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Workbook to an email address. Panagiotis Atmatzidis Excel Discussion (Misc queries) 4 April 21st 07 12:22 AM
sending a worksheet from a workbook electronically compliance data Excel Discussion (Misc queries) 2 December 21st 06 04:33 PM
Sending sheets in workbook billy2willy Excel Discussion (Misc queries) 4 July 28th 05 05:43 PM
Sending a workbook with a message MacroMan Excel Programming 1 August 8th 03 02:59 PM
Sending data to a different workbook Kevin Excel Programming 1 August 6th 03 04:46 PM


All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"