Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Form info to different spreadsheet

I have two spreadsheet's. Test1.xls which is on my C:
Drive and another spreadsheet Test2.xls which is on my H:
Drive both spreadsheets are in a file called temp.
The spreadsheet on my C: Drive contains a user form that
the user completes and then clicks on a button. I want
that information to be put on the spreadsheet on my H:\
drive.

For example I have a field on the form that the user
inserts the date (txtdate) when they click on a macro I
want it to take the date off the user form and insert it
into cell A2 on spreadsheet H:\temp\test2.xls.

I have asked before but nothing seems to work........

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Form info to different spreadsheet

Hi Glenn,

Didn't test it, but it must work :

You supposed to have a "Save" button on the form. Put this code in its
Click event :

Dim wbHDrive as Workbook

If Me.txtdate.value<"" And Not IsNull(Me.txtdate) then
Application.ScreenUpdating = False
set wbHDrive = Workbooks.Open("H:\temp\test2.xls")
With wbHDrive
..ActiveSheet.Range("A2") = Me.txtdate.Value
..Close True
end with
Application.ScreenUpdating = True
end if


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Form info to different spreadsheet

Glenn,

Straight off the top, in the C: file userform code

Workbooks.Open Filename:="H:\temp\test2.xls"
With Activeworkbook
.Worksheets("Sheet1").Range("A2").Value = txtDate.Text
.Save
.Close
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Glenn" wrote in message
...
I have two spreadsheet's. Test1.xls which is on my C:
Drive and another spreadsheet Test2.xls which is on my H:
Drive both spreadsheets are in a file called temp.
The spreadsheet on my C: Drive contains a user form that
the user completes and then clicks on a button. I want
that information to be put on the spreadsheet on my H:\
drive.

For example I have a field on the form that the user
inserts the date (txtdate) when they click on a macro I
want it to take the date off the user form and insert it
into cell A2 on spreadsheet H:\temp\test2.xls.

I have asked before but nothing seems to work........



Reply
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
excel form. Need data extracted to spreadsheet each time a form co MikeR-Oz Excel Discussion (Misc queries) 4 April 5th 09 05:18 AM
User Form Info Peter Excel Discussion (Misc queries) 4 April 13th 06 01:05 PM
How do I type info on a ceated form Lisa HH New Users to Excel 1 October 1st 05 12:16 AM
Can I create a form to run off of info saved on Excel 97? Pajama sam Charts and Charting in Excel 1 March 19th 05 12:34 PM
Adding info onto a "permanent" form Howeey Excel Worksheet Functions 1 December 25th 04 08:12 PM


All times are GMT +1. The time now is 08:57 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"