Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default To choose several sheets for synchronizing

Hi, I have a problem when implementing my coding:

I am using Ontime Method to record data from a dynamic datasource. For
better use, I organise at least 30 sheets to use this method for the same
range A1:A10, every sheet same place but different data. I wonder a way to
initiate them and stop them at the same time.

the codes are following:

Sub Update()
Dim myCell As Range
NextTime = Time + TimeValue("00:00:01")
Range("A1:A10").Copy
Set myCell = Cells(Rows.Count, 2).End(xlUp)(2)
myCell.PasteSpecial _
Paste:=xlPasteValues
With myCell.Offset(0, -1).Resize(3)
.Value = Now
.NumberFormat = "mm/dd/yy hh:mm:ss"
End With
Application.OnTime NextTime, "Update"
End Sub

When i only put this in Module, it excuted only for the activated sheet.
Hope to excute 30 sheets that I want no matter which sheet I activate.

But for the rest of the sheets, I do not want this procedure realised.

Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default To choose several sheets for synchronizing

This is a very crude method, but it works. Test a cell location. You can
make it fancy by adding a button that writes to the cell.

With myCell.Offset(0, -1).Resize(3)
.Value = Now
.NumberFormat = "mm/dd/yy hh:mm:ss"
End With
if Range("A1") = 5 then exit sub
Application.OnTime NextTime, "Update"
End Sub

"Jonathan" wrote:

Hi, I have a problem when implementing my coding:

I am using Ontime Method to record data from a dynamic datasource. For
better use, I organise at least 30 sheets to use this method for the same
range A1:A10, every sheet same place but different data. I wonder a way to
initiate them and stop them at the same time.

the codes are following:

Sub Update()
Dim myCell As Range
NextTime = Time + TimeValue("00:00:01")
Range("A1:A10").Copy
Set myCell = Cells(Rows.Count, 2).End(xlUp)(2)
myCell.PasteSpecial _
Paste:=xlPasteValues
With myCell.Offset(0, -1).Resize(3)
.Value = Now
.NumberFormat = "mm/dd/yy hh:mm:ss"
End With
Application.OnTime NextTime, "Update"
End Sub

When i only put this in Module, it excuted only for the activated sheet.
Hope to excute 30 sheets that I want no matter which sheet I activate.

But for the rest of the sheets, I do not want this procedure realised.

Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default To choose several sheets for synchronizing

Hi, Joel, maybe I couldnt quite follow your advice. But I just want to make
30 target sheets to do the same thing as I intrigued the macro.
When I just put these codes in a the module and run the macro, it only
worked for the activated sheet and the others dont work.

Hope you can help me with this

"Joel" wrote:

This is a very crude method, but it works. Test a cell location. You can
make it fancy by adding a button that writes to the cell.

With myCell.Offset(0, -1).Resize(3)
.Value = Now
.NumberFormat = "mm/dd/yy hh:mm:ss"
End With
if Range("A1") = 5 then exit sub
Application.OnTime NextTime, "Update"
End Sub

"Jonathan" wrote:

Hi, I have a problem when implementing my coding:

I am using Ontime Method to record data from a dynamic datasource. For
better use, I organise at least 30 sheets to use this method for the same
range A1:A10, every sheet same place but different data. I wonder a way to
initiate them and stop them at the same time.

the codes are following:

Sub Update()
Dim myCell As Range
NextTime = Time + TimeValue("00:00:01")
Range("A1:A10").Copy
Set myCell = Cells(Rows.Count, 2).End(xlUp)(2)
myCell.PasteSpecial _
Paste:=xlPasteValues
With myCell.Offset(0, -1).Resize(3)
.Value = Now
.NumberFormat = "mm/dd/yy hh:mm:ss"
End With
Application.OnTime NextTime, "Update"
End Sub

When i only put this in Module, it excuted only for the activated sheet.
Hope to excute 30 sheets that I want no matter which sheet I activate.

But for the rest of the sheets, I do not want this procedure realised.

Thanks in advance

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default To choose several sheets for synchronizing

Have all worksheets use the same cell on the same worksheet. I thought the
timer ws common for all the worksheets. To get everything perfectly
synchronized, you should have one time lauch all the macros.

if Sheets("Sheet1").Range("A1") = 5 then exit sub

"Jonathan" wrote:

Hi, Joel, maybe I couldnt quite follow your advice. But I just want to make
30 target sheets to do the same thing as I intrigued the macro.
When I just put these codes in a the module and run the macro, it only
worked for the activated sheet and the others dont work.

Hope you can help me with this

"Joel" wrote:

This is a very crude method, but it works. Test a cell location. You can
make it fancy by adding a button that writes to the cell.

With myCell.Offset(0, -1).Resize(3)
.Value = Now
.NumberFormat = "mm/dd/yy hh:mm:ss"
End With
if Range("A1") = 5 then exit sub
Application.OnTime NextTime, "Update"
End Sub

"Jonathan" wrote:

Hi, I have a problem when implementing my coding:

I am using Ontime Method to record data from a dynamic datasource. For
better use, I organise at least 30 sheets to use this method for the same
range A1:A10, every sheet same place but different data. I wonder a way to
initiate them and stop them at the same time.

the codes are following:

Sub Update()
Dim myCell As Range
NextTime = Time + TimeValue("00:00:01")
Range("A1:A10").Copy
Set myCell = Cells(Rows.Count, 2).End(xlUp)(2)
myCell.PasteSpecial _
Paste:=xlPasteValues
With myCell.Offset(0, -1).Resize(3)
.Value = Now
.NumberFormat = "mm/dd/yy hh:mm:ss"
End With
Application.OnTime NextTime, "Update"
End Sub

When i only put this in Module, it excuted only for the activated sheet.
Hope to excute 30 sheets that I want no matter which sheet I activate.

But for the rest of the sheets, I do not want this procedure realised.

Thanks in advance

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
synchronizing mutiple sheets to mirror the previous data FEMoore Excel Discussion (Misc queries) 0 October 10th 10 03:49 PM
Getting a Sheet to Choose to Display Other Sheets Kyle P.[_2_] Excel Discussion (Misc queries) 0 May 27th 10 10:57 PM
Repost:Synchronizing two sheets within the same workbook 50pingviner Excel Discussion (Misc queries) 2 February 2nd 06 03:13 PM
Synchronizing two sheets within the same workbook 50pingviner Excel Discussion (Misc queries) 0 January 25th 06 03:22 PM
Choose several sheets in VBA Jonsson Excel Programming 10 September 24th 04 02:31 PM


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