I would like to have a button on a graphics screen when pushed do the following in cicode or vba or whatever is best using Citect.
When pushed:
search for a excel file called master.
retrieve and paste part of four different event logs onto 1st sheet.
save information to another worksheet labeled (day1)by using date on master sheet. Example 03/01/2004 to day1, 03/02/04 to day2, worksheets.
When completed, exit out of all four retrieved worksheets.
Exit out of master workseet.
Back to original screen with pushbutton.
Below is an excel macro that does this up to the point of retrieving and saving on the 3rd worksheet. I actually what it saved as described above.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/1/04 by Connie
'
' Keyboard Shortcut: Ctrl+z
'
ChDir "C:\My Documents\excel test"
Workbooks.Open FileName:="C:\My Documents\excel test\Book1.xls"
Range("A19").Select
Selection.Copy
With ActiveWindow
.Top = 116.5
.Left = 118.75
End With
Windows("master.xls").Activate
Range("A1").Select
ActiveSheet.Paste
Range("A4").Select
Workbooks.Open FileName:="C:\My Documents\excel test\Book2.xls"
Range("B1:E11").Select
Application.CutCopyMode = False
Selection.Copy
With ActiveWindow
.Top = 76
.Left = 109
End With
Windows("master.xls").Activate
Range("E1").Select
ActiveSheet.Paste
Range("E4").Select
Sheets("Sheet2").Select
Range("A1:H11").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet3").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("A10").Select
Sheets("master").Select
Cells.Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A7").Select
Windows("Book2.xls").Activate
With ActiveWindow
.Top = 70
.Left = -20
End With
ActiveWindow.Close
Windows("Book1.xls").Activate
With ActiveWindow
.Top = 104.5
.Left = -0.5
End With
ActiveWindow.Close
Range("B2").Select
End Sub
When pushed:
search for a excel file called master.
retrieve and paste part of four different event logs onto 1st sheet.
save information to another worksheet labeled (day1)by using date on master sheet. Example 03/01/2004 to day1, 03/02/04 to day2, worksheets.
When completed, exit out of all four retrieved worksheets.
Exit out of master workseet.
Back to original screen with pushbutton.
Below is an excel macro that does this up to the point of retrieving and saving on the 3rd worksheet. I actually what it saved as described above.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/1/04 by Connie
'
' Keyboard Shortcut: Ctrl+z
'
ChDir "C:\My Documents\excel test"
Workbooks.Open FileName:="C:\My Documents\excel test\Book1.xls"
Range("A19").Select
Selection.Copy
With ActiveWindow
.Top = 116.5
.Left = 118.75
End With
Windows("master.xls").Activate
Range("A1").Select
ActiveSheet.Paste
Range("A4").Select
Workbooks.Open FileName:="C:\My Documents\excel test\Book2.xls"
Range("B1:E11").Select
Application.CutCopyMode = False
Selection.Copy
With ActiveWindow
.Top = 76
.Left = 109
End With
Windows("master.xls").Activate
Range("E1").Select
ActiveSheet.Paste
Range("E4").Select
Sheets("Sheet2").Select
Range("A1:H11").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet3").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("A10").Select
Sheets("master").Select
Cells.Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A7").Select
Windows("Book2.xls").Activate
With ActiveWindow
.Top = 70
.Left = -20
End With
ActiveWindow.Close
Windows("Book1.xls").Activate
With ActiveWindow
.Top = 104.5
.Left = -0.5
End With
ActiveWindow.Close
Range("B2").Select
End Sub