Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default copy data from one worksheet and paste into another workbook

Hi,
I have a form that I use in excel and I would like to keep track of people
that fill out the form on a seperate (hidden) workbook. I use a command
button that everyone hits to send the form, so somewhere in that code, I
would like to open another workbook, log some data (cells A1, B2, & C4), save
it, and then continue on....all hidden, so the user never sees it.

Any help would be very appreciated. Thanks,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default copy data from one worksheet and paste into another workbook

wouldn't it be easier simple to append to a log ( text) file....both
extremely fast and totally invisible to the user..

Use the File System Object which is in this library...
set a reference to the scripting runtime dll in the IDE ( Tools/references...)

Sub Logger()
Dim FSO As Scripting.FileSystemObject
Dim txt As Scripting.TextStream
Dim LogPath As String
Dim LogFile As String
LogPath = "S:\logging"
LogFile = "logfile.txt"

Set FSO = New Scripting.FileSystemObject

' chech file exists
If FSO.DriveExists(Left(LogPath, 1)) Then

If FSO.FolderExists(LogPath) Then


Else

FSO.CreateFolder (LogPath)

End If

Set txt = FSO.OpenTextFile(LogPath & "\" & LogFile, ForAppending,
True)

txt.WriteLine Format(Now, "dd-mmm-yyyy HH:MM")

txt.WriteLine Range("A1").Value
txt.WriteLine Range("A2").Value
txt.WriteLine Range("A3").Value
txt.WriteLine "-----------------"
txt.Close

Set txt = Nothing

Else
' drive doesn't exist - raise an alert
End If
Set FSO = Nothing

End Sub

Patrick Molloy
Microsoft xcel MVP


"Mike R." wrote:

Hi,
I have a form that I use in excel and I would like to keep track of people
that fill out the form on a seperate (hidden) workbook. I use a command
button that everyone hits to send the form, so somewhere in that code, I
would like to open another workbook, log some data (cells A1, B2, & C4), save
it, and then continue on....all hidden, so the user never sees it.

Any help would be very appreciated. Thanks,

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
Copy and Paste Chart as Picture into another workbook or worksheet SteveC Charts and Charting in Excel 1 February 15th 07 11:47 PM
How do I copy & paste only the unhidden data on a worksheet ? Johnson748r Excel Discussion (Misc queries) 1 June 30th 06 06:41 AM
How can i copy and paste data when there is a filter in the worksheet.... dalipsinghbisht Excel Discussion (Misc queries) 5 March 18th 06 12:38 PM
Copy worksheet and paste it in New workbook, all data except Formulas Sudarshan Excel Programming 4 May 26th 04 06:51 PM
Copy and paste the worksheet to New workbook.. Sudarshan[_3_] Excel Programming 1 May 26th 04 06:51 PM


All times are GMT +1. The time now is 11:38 AM.

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"