Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a VBA code to apply values from a UserForm to a Worksheet. My code
inserts the Label Control Captino into the Cell. How can I force the cell to have an accounting format. Private Sub cmbApplyTax_Click() Dim mySalesTax As Range Dim myRow As Long Dim mySubTotal As Double, myFreight As Double 'finds Sales Tax cell on the QUOTE sheet Set mySalesTax = Sheets("QUOTE").Columns("E:E").Find(What:="Sales Tax", _ After:=Cells(6, 5), _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False) Sheets("QUOTE").Unprotect "AdTech" 'show tax exempt If optTaxExempt = True Then mySalesTax.Offset(0, 1).Value = "Tax Exempt" End If 'adds 6% sales tax If optSalesTax6 = True Then mySalesTax.Offset(0, 1) = lblSalesTax6 Range("F7:F8").NumberFormat = "Accounting" <==Error Error End If 'adds 7% sales tax If optSalesTax7 = True Then mySalesTax.Offset(0, 1) = lblSalesTax7 Range("F7:F8").NumberFormat = "Accounting" <==Error Error End If Sheets("QUOTE").Protect "AdTech" Unload Me End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I display text when a cell value is 0 for accounting? | Excel Worksheet Functions | |||
How do I display text when a cell value is 0 for accounting? | Excel Worksheet Functions | |||
accounting format for zero show 0.00 in one cell "-" in another | Excel Discussion (Misc queries) | |||
cell formate | Excel Discussion (Misc queries) | |||
Link the formate from one cell to a nother in diffrent sheet | Excel Worksheet Functions |