J
Jim Berglund
Your responses to my last concerns were great and solved the problem. I seem
to have created a new one that it doesn't address...
Private Sub CommandButton1_Click() 'Normalize
Dim i, j, numberofRows As Integer
Application.ScreenUpdating = False
Sheets("YTD BD").Activate
Range("A1").Select
numberofRows = ActiveCell.CurrentRegion.Rows.Count
numberofColumns = ActiveCell.CurrentRegion.Columns.Count
Range(Cells(2, 1), Cells(numberofRows, 5)).Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
*** The following line gave the 1004 error
ActiveSheet.Range(Cells(1, numberofColumns + 2)).Select
*** So I tried:
With ActiveSheet
.Range(.Cells(1, numberofColumns + 2)).Select
End With
Which also gave me the same 1004 error.
Any advice?
Thanks,
Jim Berglund
to have created a new one that it doesn't address...
Private Sub CommandButton1_Click() 'Normalize
Dim i, j, numberofRows As Integer
Application.ScreenUpdating = False
Sheets("YTD BD").Activate
Range("A1").Select
numberofRows = ActiveCell.CurrentRegion.Rows.Count
numberofColumns = ActiveCell.CurrentRegion.Columns.Count
Range(Cells(2, 1), Cells(numberofRows, 5)).Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
*** The following line gave the 1004 error
ActiveSheet.Range(Cells(1, numberofColumns + 2)).Select
*** So I tried:
With ActiveSheet
.Range(.Cells(1, numberofColumns + 2)).Select
End With
Which also gave me the same 1004 error.
Any advice?
Thanks,
Jim Berglund