Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a sheet at set times

Hi,
I was hoping someone could help with this,I have very
little experience with excel but not unfamiliar with
programming (mostly PLC programming).So here's my dilemma:
I am importing data from a dde server (directsoft32 data
server) into cells which works fine,I can create a macro
to move the data to another sheet,but I need to move to 3
different sheets depending on the time. (8:00,4:00,12:00),
and reset the counters in the plc.
I aquire the data with:
c3=dsdata|weightcell1!'v2001'
c4=dsdata|weightcell2!'v2004'
c5=dsdata|weightcell3!'v2007'
c6=dsdata|weightcell4!'v2010'
c6=dsdata|Cam1!'v1001' (Pass Counter)
c8=dsdata|Cam1!'v1002' (Fail Counter)
c9=dsdata|Cam2!'v1003' (Pass Counter)
c10=dsdata|Cam2!'v1004' (Fail Counter)
c11=dsdata|Cam3!'v1005' (Pass Counter)
c12=dsdata|Cam3!'v1006' (Fail Counter)
c13=dsdata|Cam1!'v1007' (Pass Counter)
c14=dsdata|Cam1!'v1008' (Fail Counter)

The "V"s are memory locations in the plc that I'm
referencing.

And to reset I use a macro:
Sub Button1_Click()
Channel = DDEInitiate ("Dsdata","weightcells")
DDEPoke Channel,"V2001", 0
DDEPoke Channel,"V2002", 0
DDEPoke Channel,"V2003", 0
DDEPoke Channel,"V2004", 0
DDETerminate (Channel)
Channel = DDEInitiate ("Dsdata","Cameras")
DDEPoke Channel,"V1001", 0
DDEPoke Channel,"V1002", 0
DDEPoke Channel,"V1003", 0
DDEPoke Channel,"V1004", 0
DDEPoke Channel,"V1005", 0
DDEPoke Channel,"V1006", 0
DDEPoke Channel,"V1007", 0
DDEPoke Channel,"V1008", 0
DDETerminate (Channel)
End Sub

Any help would be greatly appreciated
Thanks in advance
Blue Skies
Scott
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Creating a sheet at set times

Hello Scott,

You can specify the worksheets with worksheet object.
It can be done with the name of the worksheet or index,
Eg, Sheets(1) stands for Very left worksheet in the active workbook.
If the name of the Sheets(1) is Sheet1, then you can also specify the
worksheet as Sheets("Sheet1").

With NOW function, VBA returns the system time(including date), I think you
can use it for judging time.

--
Kind Regards
Colo ------------------------------------------------------------------
Masaru Kaji (aka Colo) Office Systems - Excel MSMVP(2004-2005)

Web site: Colo's Excel Junk Room
http://www.interq.or.jp/sun/puremis/colo/

Email:

------------------------------------------------------------------

"Scott" wrote in message
...
Hi,
I was hoping someone could help with this,I have very
little experience with excel but not unfamiliar with
programming (mostly PLC programming).So here's my dilemma:
I am importing data from a dde server (directsoft32 data
server) into cells which works fine,I can create a macro
to move the data to another sheet,but I need to move to 3
different sheets depending on the time. (8:00,4:00,12:00),
and reset the counters in the plc.
I aquire the data with:
c3=dsdata|weightcell1!'v2001'
c4=dsdata|weightcell2!'v2004'
c5=dsdata|weightcell3!'v2007'
c6=dsdata|weightcell4!'v2010'
c6=dsdata|Cam1!'v1001' (Pass Counter)
c8=dsdata|Cam1!'v1002' (Fail Counter)
c9=dsdata|Cam2!'v1003' (Pass Counter)
c10=dsdata|Cam2!'v1004' (Fail Counter)
c11=dsdata|Cam3!'v1005' (Pass Counter)
c12=dsdata|Cam3!'v1006' (Fail Counter)
c13=dsdata|Cam1!'v1007' (Pass Counter)
c14=dsdata|Cam1!'v1008' (Fail Counter)

The "V"s are memory locations in the plc that I'm
referencing.

And to reset I use a macro:
Sub Button1_Click()
Channel = DDEInitiate ("Dsdata","weightcells")
DDEPoke Channel,"V2001", 0
DDEPoke Channel,"V2002", 0
DDEPoke Channel,"V2003", 0
DDEPoke Channel,"V2004", 0
DDETerminate (Channel)
Channel = DDEInitiate ("Dsdata","Cameras")
DDEPoke Channel,"V1001", 0
DDEPoke Channel,"V1002", 0
DDEPoke Channel,"V1003", 0
DDEPoke Channel,"V1004", 0
DDEPoke Channel,"V1005", 0
DDEPoke Channel,"V1006", 0
DDEPoke Channel,"V1007", 0
DDEPoke Channel,"V1008", 0
DDETerminate (Channel)
End Sub

Any help would be greatly appreciated
Thanks in advance
Blue Skies
Scott


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
Creating a new sheet from specific data in existing sheet Rosscoe Excel Discussion (Misc queries) 2 January 13th 10 03:07 PM
Creating form on sheet 1 and having info move to sheet 2 SHARON Excel Discussion (Misc queries) 4 June 1st 09 05:01 PM
How do you copy a sheet times 50 tripflex Excel Discussion (Misc queries) 2 March 5th 09 11:01 PM
Creating a Macro to Record Lap Times MelNeedsHelp! Excel Discussion (Misc queries) 2 October 25th 06 11:41 PM
Creating a chart from two tables of Times Stevie_J Excel Discussion (Misc queries) 1 July 23rd 05 08:56 PM


All times are GMT +1. The time now is 06:01 AM.

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

About Us

"It's about Microsoft Excel"