M
megatron08
Here is my Userform that I created:
Sub Import()
'
' Import Macro
' Macro recorded 08/06/2008 by christopherr
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;Y:\Financial Services\FS2008\Woodworkers\ER
Reports\052008\Test\Original Weyerhaeuser.TOC May 08.200806172100086.txt" _
, Destination:=Range("A1"))
.Name = "Original Weyerhaeuser.NelsonTrust.200806172055088"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Totals"
End Sub
Private Sub CommandButton1_Click()
Import
End Sub
Sub SubTotalERCode()
'
' SubTotalERCode Macro
' Macro recorded 08/06/2008 by christopherr
'
'
Selection.Subtotal GroupBy:=14, Function:=xlCount, TotalList:=Array(14), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
ActiveWindow.SmallScroll Down:=-42
Columns("M:M").EntireColumn.AutoFit
ActiveWindow.SmallScroll Down:=42
End Sub
Private Sub CommandButton2_Click()
SubTotalERCode
End Sub
Sub Subtotals()
'
' Subtotals Macro
' Macro recorded 08/08/2008 by christopherr
'
'
ActiveWindow.SmallScroll Down:=-63
Range("I1").Select
Selection.Subtotal GroupBy:=13, Function:=xlSum, TotalList:=Array(9,
10), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
ActiveWindow.SmallScroll Down:=81
End Sub
Private Sub CommandButton3_Click()
Subtotals
End Sub
Sub Worksheet()
'
' WorkSheet Macro
' Macro recorded 08/06/2008 by christopherr
'
'
Range("A2:N65").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Columns("E:E").EntireColumn.AutoFit
Columns("H:H").EntireColumn.AutoFit
Columns("A:A").EntireColumn.AutoFit
Sheets("Totals").Select
Application.CutCopyMode = False
End Sub
So macro sub Worksheet is selecting the data in range A2:A65.
I would like to have my user manually select the data range within the user
form.
I've researched this thread hoping to find similar suggestions/ideas, but
found none which is why I'm sending this request.
TIA
~Christopher
Sub Import()
'
' Import Macro
' Macro recorded 08/06/2008 by christopherr
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;Y:\Financial Services\FS2008\Woodworkers\ER
Reports\052008\Test\Original Weyerhaeuser.TOC May 08.200806172100086.txt" _
, Destination:=Range("A1"))
.Name = "Original Weyerhaeuser.NelsonTrust.200806172055088"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Totals"
End Sub
Private Sub CommandButton1_Click()
Import
End Sub
Sub SubTotalERCode()
'
' SubTotalERCode Macro
' Macro recorded 08/06/2008 by christopherr
'
'
Selection.Subtotal GroupBy:=14, Function:=xlCount, TotalList:=Array(14), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
ActiveWindow.SmallScroll Down:=-42
Columns("M:M").EntireColumn.AutoFit
ActiveWindow.SmallScroll Down:=42
End Sub
Private Sub CommandButton2_Click()
SubTotalERCode
End Sub
Sub Subtotals()
'
' Subtotals Macro
' Macro recorded 08/08/2008 by christopherr
'
'
ActiveWindow.SmallScroll Down:=-63
Range("I1").Select
Selection.Subtotal GroupBy:=13, Function:=xlSum, TotalList:=Array(9,
10), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
ActiveWindow.SmallScroll Down:=81
End Sub
Private Sub CommandButton3_Click()
Subtotals
End Sub
Sub Worksheet()
'
' WorkSheet Macro
' Macro recorded 08/06/2008 by christopherr
'
'
Range("A2:N65").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Columns("E:E").EntireColumn.AutoFit
Columns("H:H").EntireColumn.AutoFit
Columns("A:A").EntireColumn.AutoFit
Sheets("Totals").Select
Application.CutCopyMode = False
End Sub
So macro sub Worksheet is selecting the data in range A2:A65.
I would like to have my user manually select the data range within the user
form.
I've researched this thread hoping to find similar suggestions/ideas, but
found none which is why I'm sending this request.
TIA
~Christopher