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: 3
Default OPC Data Collector

I have the following code, which will save a copy of the workbook as a given
name and the current date and time when a value of 1 is moved into a cell.
The code seems to work as I expect it to. I would like to refine it to save
a copy of certain sheets in the workbook instead of the entire workbook, and
name and store the copy the same way it is in the existin code. This way the
user opening the copies isn't promted to update external data. Can anyone
Help? Thanks in advance...

******************

Private Sub Worksheet_Calculate()

Dim Inrange As Range
Dim rng As Range
Set Inrange = Range("H1")
For Each rng In Inrange.Cells
If Not IsError(rng.Value) Then
If Me.Range("H1").Value = "1" Then
MsgBox "Saving a Dated Copy...."
Application.EnableEvents = False
ActiveWorkbook.SaveCopyAs Filename:="C:\Data\" & _
Replace(ActiveWorkbook.Name, ".xls", _
" " & Format(Now, "yyyy-mm-dd-hh-mm") & ".xls")
Application.EnableEvents = True
End If
End If
Next rng

End Sub
*****************
 
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
Data Labels- POssible to show data value and data label together? kippers Charts and Charting in Excel 1 April 1st 09 01:33 PM
Increase Your Business By Data Conversion, Data Format and Data EntryServices in India Data Entry India Excel Worksheet Functions 1 March 31st 08 12:51 PM
Save 20% On Data Conversion and Data Formats Services by Data EntryIndia Data Entry India Excel Discussion (Misc queries) 0 March 31st 08 12:00 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing [email protected] Excel Discussion (Misc queries) 0 March 20th 08 12:45 PM
Import Data / Edit Data / Export Data in Excel Mathias Fritsch Excel Programming 0 July 19th 07 04:08 PM


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