I am trying to finish off a form that allows a user to insert a row below the selected cell and copy the formula from the line above if one exists. The code inserts the line but does not copy the formulas if they exist. any help is appreciated.
Guy
Code
Application.ScreenUpdating = False
Dim cRow
Dim j As Long
cRow = ActiveCell.Row
With ActiveCell
.EntireRow.Insert
End With
For j = 1 To Cells(1, 255).End(xlToLeft).Column
If Cells(cRow, j).HasFormula Then Cells(cRow, j).Copy Cells(cRow + 1, j)
Next j
Application.ScreenUpdating = True
Application.CutCopyMode = False
Unload Add_Date_Form
End Sub
Private Sub CommandButton2_Click()
Unload Add_Date_Form
End Sub
Private Sub UserForm_Initialize()
Dim cRow
cRow = ActiveCell.Row ' remember the current row
TextBox1 = Cells(cRow, Range("column_date").Column).Value
End Sub
Display More