Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, I want a macro to pause to select manually a file, and then format it.
I have attached macro, how to modify it? ' Controller_Openen_decimale_punt Macro ' Macro recorded 7/4/2007 by CROMMENTUIJN Leon ' ' ChDir "C:" Workbooks.OpenText Filename:="C:\Emerson\log.htm", Origin:=437, StartRow _ :=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(8, 1), Array( _ 14, 1), Array(15, 1)), TrailingMinusNumbers:=True Columns("C:C").Select Selection.Delete Shift:=xlToLeft Columns("A:C").Select Range("C1").Activate Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=Sheets("log").Range("A1:C192"), PlotBy:= _ xlColumns ActiveChart.Location Whe=xlLocationAsNewSheet With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = "Temperatuurverloop" .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "[C]" .Axes(xlValue, xlPrimary).HasTitle = False End With End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use GetOpenFileName Method
Sub test1() fileToOpen = Application _ .GetOpenFilename("Text Files (*.txt), *.txt") If fileToOpen < False Then Workbooks.OpenText Filename:=fileToOpen, _ Origin:=437, _ StartRow:=1, _ DataType:=xlFixedWidth, _ FieldInfo:= _ Array(Array(0, 1), Array(8, 1), Array(14, 1), Array(15, 1)), _ TrailingMinusNumbers:=True Columns("C:C").Select Selection.Delete Shift:=xlToLeft Columns("A:C").Select Range("C1").Activate Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData _ Source:=Sheets("log").Range("A1:C192"), _ PlotBy:=xlColumns ActiveChart.Location Whe=xlLocationAsNewSheet With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = "Temperatuurverloop" .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "[C]" .Axes(xlValue, xlPrimary).HasTitle = False End With End If End Sub "Leon" wrote: Hello, I want a macro to pause to select manually a file, and then format it. I have attached macro, how to modify it? ' Controller_Openen_decimale_punt Macro ' Macro recorded 7/4/2007 by CROMMENTUIJN Leon ' ' ChDir "C:" Workbooks.OpenText Filename:="C:\Emerson\log.htm", Origin:=437, StartRow _ :=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(8, 1), Array( _ 14, 1), Array(15, 1)), TrailingMinusNumbers:=True Columns("C:C").Select Selection.Delete Shift:=xlToLeft Columns("A:C").Select Range("C1").Activate Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=Sheets("log").Range("A1:C192"), PlotBy:= _ xlColumns ActiveChart.Location Whe=xlLocationAsNewSheet With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = "Temperatuurverloop" .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "[C]" .Axes(xlValue, xlPrimary).HasTitle = False End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can a macro be run on opening the file? | Excel Discussion (Misc queries) | |||
Opening a file through a macro - Help!! | Excel Programming | |||
File opening via Macro with varying file name | Excel Programming | |||
Opening a file with a Macro | Excel Discussion (Misc queries) |