Hi,
I have this blank cell that I want to link to a userform textbox. If I enter a number including 0, it gets populated to the userform textbox correctly without errors. If I leave the cell blank, then I get a Data Type compatibility error message.
Here is my code within the userform "DistrDepensesCaisseCAN":
Private Sub UserForm_Activate()
DistrDepensesCaisseCAN.BudgetNourritureCAN.Value = Format(Worksheets("Budget Caisse").Range("D8").Value, "0.00")
BudgetCaisseTotalCAN.Text = CDbl(BudgetNourritureCAN.Text)
End Sub
Thank you for your precious help
Pierre
I have this blank cell that I want to link to a userform textbox. If I enter a number including 0, it gets populated to the userform textbox correctly without errors. If I leave the cell blank, then I get a Data Type compatibility error message.
Here is my code within the userform "DistrDepensesCaisseCAN":
Private Sub UserForm_Activate()
DistrDepensesCaisseCAN.BudgetNourritureCAN.Value = Format(Worksheets("Budget Caisse").Range("D8").Value, "0.00")
BudgetCaisseTotalCAN.Text = CDbl(BudgetNourritureCAN.Text)
End Sub
Thank you for your precious help
Pierre