SailFL
09-11-2005, 12:58 AM
Killian,
I have another problem......
I don't want the price or labor cost to show on the form unless there is a sqft value. So how I can I check the excel spreadsheet cell for a sqft value and if it has a value than go ahead and display the price and labor cost.
Or would it be better to create a an array of of flags. When a SqFt was given a value the flag would be true for that item and use that to determine if the to display the corresponding price and laborcost. But I would rather do it off of the spreadsheet.
I am open to suggestions, please.
Thanks
Private Sub Worksheet_Calculate()
Dim ctrl As MSForms.Control
' If the Labor Cost change, display new labor cost
' If the price changes, display new price
For Each ctrl In UserForm1.Controls
' Here I want to check the value of SqFt to determine if I am going to display
' the values for Labor Cost and Price????
If Left(ctrl.Name, 9) = "LaborCost" Then
ctrl.Value = ActiveSheet.Range(ctrl.Tag).Value
End If
If Left(ctrl.Name, 5) = "Price" Then
ctrl.Value = ActiveSheet.Range(ctrl.Tag).Value
End If
Next
End Sub
I have another problem......
I don't want the price or labor cost to show on the form unless there is a sqft value. So how I can I check the excel spreadsheet cell for a sqft value and if it has a value than go ahead and display the price and labor cost.
Or would it be better to create a an array of of flags. When a SqFt was given a value the flag would be true for that item and use that to determine if the to display the corresponding price and laborcost. But I would rather do it off of the spreadsheet.
I am open to suggestions, please.
Thanks
Private Sub Worksheet_Calculate()
Dim ctrl As MSForms.Control
' If the Labor Cost change, display new labor cost
' If the price changes, display new price
For Each ctrl In UserForm1.Controls
' Here I want to check the value of SqFt to determine if I am going to display
' the values for Labor Cost and Price????
If Left(ctrl.Name, 9) = "LaborCost" Then
ctrl.Value = ActiveSheet.Range(ctrl.Tag).Value
End If
If Left(ctrl.Name, 5) = "Price" Then
ctrl.Value = ActiveSheet.Range(ctrl.Tag).Value
End If
Next
End Sub