kabushnell
Technical User
I am creating a macro in excel that uses formulas to create new columns based on previous columns in the worksheet. The problem I am having is that the range of rows varies everytime. How do I create a macro that will only create the same number of rows that is in the worksheet everytime. This is what I have right now.
Sub DailyProcessingPart2()
'
' DailyProcessingPart2 Macro
' Macro recorded 6/10/2003 by Keith Bushnell
'
'
Sheets("transpose"
.Select
Selection.SpecialCells(xlCellTypeLastCell).Select
Range("A58"
.Select
Selection.Clear
Range("I57"
.Select
ActiveCell.FormulaR1C1 = "=REPLACE(RC[-8],7,9,""/03""
"
Range("J57"
.Select
ActiveCell.FormulaR1C1 = "=MID(RC[-1],2,8)"
Range("K57"
.Select
ActiveCell.FormulaR1C1 = "=MID(RC[-8],2,6)"
Range("L57"
.Select
ActiveCell.FormulaR1C1 = "=MID(RC[-8],2,25)"
Range("M57"
.Select
ActiveCell.FormulaR1C1 = "=MID(RC[-8],2,10)"
Range("N57"
.Select
ActiveCell.FormulaR1C1 = "=RC[-6]"
Range("I57:N57"
.Select
Selection.AutoFill Destination:=Range("I1:N57"
, Type:=xlFillDefault
Range("I1:N57"
.Select
End Sub
The problem is that some days there can be more than 57 rows and others less. How do I set this up so that it will auto fill the proper amount.
Thanks for any help.
Sub DailyProcessingPart2()
'
' DailyProcessingPart2 Macro
' Macro recorded 6/10/2003 by Keith Bushnell
'
'
Sheets("transpose"
Selection.SpecialCells(xlCellTypeLastCell).Select
Range("A58"
Selection.Clear
Range("I57"
ActiveCell.FormulaR1C1 = "=REPLACE(RC[-8],7,9,""/03""
Range("J57"
ActiveCell.FormulaR1C1 = "=MID(RC[-1],2,8)"
Range("K57"
ActiveCell.FormulaR1C1 = "=MID(RC[-8],2,6)"
Range("L57"
ActiveCell.FormulaR1C1 = "=MID(RC[-8],2,25)"
Range("M57"
ActiveCell.FormulaR1C1 = "=MID(RC[-8],2,10)"
Range("N57"
ActiveCell.FormulaR1C1 = "=RC[-6]"
Range("I57:N57"
Selection.AutoFill Destination:=Range("I1:N57"
Range("I1:N57"
End Sub
The problem is that some days there can be more than 57 rows and others less. How do I set this up so that it will auto fill the proper amount.
Thanks for any help.