WorksheetFunction 物件 (Excel)
做為可從 Visual Basic 中呼叫之 Microsoft Excel 工作表函數的容器。
範例
使用 Application 物件的 WorksheetFunction 屬性可傳回 WorksheetFunction 物件。
下列範例會顯示將 Min 工作表函數套用到 A1:C10 範圍之後的結果。
Set myRange = Worksheets("Sheet1").Range("A1:C10")
answer = Application.WorksheetFunction.Min(myRange)
MsgBox answer
此範例會使用 CountA 工作表函數來判斷欄 A 中有多少儲存格內含有值。 在此範例中,欄 A 中的值應為文字。 此範例會針對欄 A 中的各個值進行拼字檢查,如果值的拼字錯誤,會將「錯誤」兩個字插入欄 B。否則,會將「確定」這兩個字插入欄 B。
Sub StartSpelling()
'Set up your variables
Dim iRow As Integer
'And define your error handling routine.
On Error GoTo ERRORHANDLER
'Go through all the cells in column A, and perform a spellcheck on the value.
'If the value is spelled incorrectly, write "Wrong" in column B; otherwise, write "OK".
For iRow = 1 To WorksheetFunction.CountA(Columns(1))
If Application.CheckSpelling( _
Cells(iRow, 1).Value, , True) = False Then
Cells(iRow, 2).Value = "Wrong"
Else
Cells(iRow, 2).Value = "OK"
End If
Next iRow
Exit Sub
'Error handling routine.
ERRORHANDLER:
MsgBox "The spell check feature is not installed!"
End Sub
方法
- AccrInt
- AccrIntM
- Acos
- Acosh
- Acot
- Acoth
- Aggregate
- AmorDegrc
- AmorLinc
- And
- 阿拉伯文
- Asc
- Asin
- Asinh
- Atan2
- Atanh
- AveDev
- Average
- AverageIf
- AverageIfs
- BahtText
- Base
- BesselI
- BesselJ
- BesselK
- BesselY
- Beta_Dist
- Beta_Inv
- BetaDist
- BetaInv
- Bin2Dec
- Bin2Hex
- Bin2Oct
- Binom_Dist
- Binom_Dist_Range
- Binom_Inv
- BinomDist
- Bitand
- Bitlshift
- Bitor
- Bitrshift
- Bitxor
- Ceiling
- Ceiling_Math
- Ceiling_Precise
- ChiDist
- ChiInv
- ChiSq_Dist
- ChiSq_Dist_RT
- ChiSq_Inv
- ChiSq_Inv_RT
- ChiSq_Test
- ChiTest
- Choose
- Clean
- Combin
- Combina
- Complex
- Confidence
- Confidence_Norm
- Confidence_T
- Convert
- Correl
- Cosh
- Cot
- Coth
- 數目
- CountA
- CountBlank
- CountIf
- CountIfs
- CoupDayBs
- CoupDays
- CoupDaysNc
- CoupNcd
- CoupNum
- CoupPcd
- Covar
- Covariance_P
- Covariance_S
- CritBinom
- Csc
- Csch
- CumIPmt
- CumPrinc
- DAverage
- 日
- Days360
- Db
- Dbcs
- DCount
- DCountA
- Ddb
- Dec2Bin
- Dec2Hex
- Dec2Oct
- Decimal
- 度數
- Delta
- DevSq
- DGet
- 光碟
- DMax
- DMin
- Dollar
- DollarDe
- DollarFr
- DProduct
- DStDev
- DStDevP
- DSum
- Duration
- DVar
- DVarP
- EDate
- Effect
- EncodeUrl
- EoMonth
- Erf
- Erf_Precise
- ErfC
- ErfC_Precise
- Even
- Expon_Dist
- ExponDist
- F_Dist
- F_Dist_RT
- F_Inv
- F_Inv_RT
- F_Test
- Fact
- FactDouble
- FDist
- FilterXML
- Find
- FindB
- FInv
- Fisher
- FisherInv
- 固定
- Floor
- Floor_Math
- Floor_Precise
- Forecast
- Forecast_ETS
- Forecast_ETS_ConfInt
- Forecast_ETS_Seasonality
- Forecast_ETS_STAT
- Forecast_Linear
- Frequency
- FTest
- Fv
- FVSchedule
- Gamma
- Gamma_Dist
- Gamma_Inv
- GammaDist
- GammaInv
- GammaLn
- GammaLn_Precise
- 高斯
- Gcd
- GeoMean
- GeStep
- Growth
- HarMean
- Hex2Bin
- Hex2Dec
- Hex2Oct
- HLookup
- HypGeom_Dist
- HypGeomDist
- IfError
- IfNa
- ImAbs
- Imaginary
- ImArgument
- ImConjugate
- ImCos
- ImCosh
- ImCot
- ImCsc
- ImCsch
- ImDiv
- ImExp
- ImLn
- ImLog10
- ImLog2
- ImPower
- ImProduct
- ImReal
- ImSec
- ImSech
- ImSin
- ImSinh
- ImSqrt
- ImSub
- ImSum
- ImTan
- Index
- Intercept
- IntRate
- Ipmt
- Irr
- IsErr
- IsError
- IsEven
- IsFormula
- IsLogical
- IsNA
- IsNonText
- IsNumber
- ISO_Ceiling
- IsOdd
- IsoWeekNum
- Ispmt
- IsText
- Kurt
- 大
- Lcm
- LinEst
- Ln
- Log
- Log10
- LogEst
- LogInv
- LogNorm_Dist
- LogNorm_Inv
- LogNormDist
- Lookup
- Match
- 最大值
- MDeterm
- MDuration
- Median
- 最小值
- MInverse
- MIrr
- MMult
- 模式
- Mode_Mult
- Mode_Sngl
- MRound
- MultiNomial
- Munit
- NegBinom_Dist
- NegBinomDist
- NetworkDays
- NetworkDays_Intl
- Nominal
- Norm_Dist
- Norm_Inv
- Norm_S_Dist
- Norm_S_Inv
- NormDist
- NormInv
- NormSDist
- NormSInv
- NPer
- Npv
- NumberValue
- Oct2Bin
- Oct2Dec
- Oct2Hex
- Odd
- OddFPrice
- OddFYield
- OddLPrice
- OddLYield
- 或
- PDuration
- Pearson
- Percentile
- Percentile_Exc
- Percentile_Inc
- PercentRank
- PercentRank_Exc
- PercentRank_Inc
- Permut
- Permutationa
- Phi
- Phonetic
- Pi
- Pmt
- Poisson
- Poisson_Dist
- 電力
- Ppmt
- Price
- PriceDisc
- PriceMat
- Prob
- 產品
- Proper
- Pv
- Quartile
- Quartile_Exc
- Quartile_Inc
- Quotient
- 弧度
- RandBetween
- Rank
- Rank_Avg
- Rank_Eq
- Rate
- 收到日期
- Replace
- ReplaceB
- Rept
- Roman
- Round
- RoundDown
- RoundUp
- Rri
- RSq
- RTD
- 搜尋
- SearchB
- Sec
- Sech
- SeriesSum
- Sinh
- Skew
- Skew_p
- Sln
- 斜面
- 小
- SqrtPi
- Standardize
- StDev
- StDev_P
- StDev_S
- StDevP
- StEyx
- Substitute
- Subtotal
- Sum
- SumIf
- SumIfs
- SumProduct
- SumSq
- SumX2MY2
- SumX2PY2
- SumXMY2
- Syd
- T_Dist
- T_Dist_2T
- T_Dist_RT
- T_Inv
- T_Inv_2T
- T_Test
- Tanh
- TBillEq
- TBillPrice
- TBillYield
- TDist
- Text
- TInv
- Transpose
- Trend
- Trim
- TrimMean
- TTest
- Unichar
- Unicode
- USDollar
- Var
- Var_P
- Var_S
- VarP
- Vdb
- VLookup
- WebService
- 工作日
- WeekNum
- Weibull
- Weibull_Dist
- WorkDay
- WorkDay_Intl
- Xirr
- Xnpv
- Xor
- YearFrac
- YieldDisc
- YieldMat
- Z_Test
- ZTest
屬性
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。