D
Dennis
Using Excel 2003
Need help using my variables below to select a myRange
that represents one Row by "UsedRange" columns wide.
I want to insert the Range in the loop below but I do not
know how to Code the information into Range.Select
compatible formula.
I did not include the "Dim" statements below.
Sub Replace()
myRowNumber = ActiveCell.Row
myColumnNumber = ActiveCell.Column
myLastColumn = ActiveSheet.UsedRange.Column - 1 +
ActiveSheet.UsedRange.Columns.Count
For myColumnNumber = 1 To myLastColumn
On Error Resume Next
' Set myRange = Intersect(ActiveSheet.UsedRange, Columns
(myColumnNumber), Cells.SpecialCells(xlCellTypeBlanks))
'
' NEED CODE FOR THE ABOVE THAT WOULD WORK WITH MY
VARIABLES
'
For Each myCell In myRange
If myCell.Offset(-1, 0).HasFormula Then
myCell.Formula = myCell.Offset(-1, 0).Formula
Else
myCell.Formula = myCell.Offset(-1, 0).Value
End If
Next myCell
Next myColumnNumber
End Sub
TIA Dennis
Need help using my variables below to select a myRange
that represents one Row by "UsedRange" columns wide.
I want to insert the Range in the loop below but I do not
know how to Code the information into Range.Select
compatible formula.
I did not include the "Dim" statements below.
Sub Replace()
myRowNumber = ActiveCell.Row
myColumnNumber = ActiveCell.Column
myLastColumn = ActiveSheet.UsedRange.Column - 1 +
ActiveSheet.UsedRange.Columns.Count
For myColumnNumber = 1 To myLastColumn
On Error Resume Next
' Set myRange = Intersect(ActiveSheet.UsedRange, Columns
(myColumnNumber), Cells.SpecialCells(xlCellTypeBlanks))
'
' NEED CODE FOR THE ABOVE THAT WOULD WORK WITH MY
VARIABLES
'
For Each myCell In myRange
If myCell.Offset(-1, 0).HasFormula Then
myCell.Formula = myCell.Offset(-1, 0).Formula
Else
myCell.Formula = myCell.Offset(-1, 0).Value
End If
Next myCell
Next myColumnNumber
End Sub
TIA Dennis