R
RyanH
I have a named range that I Set as an object. The range is made up of 3
cells all on the same row. Can I change the value of the first, second, and
third cell of that named range? For example,
Private Sub TestRange()
Dim rngEngineering As Range
With Sheets("Global Schedule")
' Engineering
If chkEngineering = True Then
Set rngEngineering = .Range(Cells(ActiveCell.Row, "T"),
Cells(ActiveCell.Row, "V"))
.rngEngineering(1) = dtpEngineering
.rngEngineering(2) = tbxEngineeringEstHrs.Text ' use .Text to
avoid cell error: Number Stored as Text
.rngEngineering(3) = tbxEngineeringActHrs.Text ' use .Text to
avoid cell error: Number Stored as Text
' change font color to black if not done, grey if done
If chkEngineeringDone = True Then
.rngEngineering.Font.ColorIndex = 15
Else
.rngEngineering.Font.ColorIndex = xlAutomatic
End If
Else
.rngEngineering.ClearContents ' remove from schedule if false
End If
End With
cells all on the same row. Can I change the value of the first, second, and
third cell of that named range? For example,
Private Sub TestRange()
Dim rngEngineering As Range
With Sheets("Global Schedule")
' Engineering
If chkEngineering = True Then
Set rngEngineering = .Range(Cells(ActiveCell.Row, "T"),
Cells(ActiveCell.Row, "V"))
.rngEngineering(1) = dtpEngineering
.rngEngineering(2) = tbxEngineeringEstHrs.Text ' use .Text to
avoid cell error: Number Stored as Text
.rngEngineering(3) = tbxEngineeringActHrs.Text ' use .Text to
avoid cell error: Number Stored as Text
' change font color to black if not done, grey if done
If chkEngineeringDone = True Then
.rngEngineering.Font.ColorIndex = 15
Else
.rngEngineering.Font.ColorIndex = xlAutomatic
End If
Else
.rngEngineering.ClearContents ' remove from schedule if false
End If
End With