WorksheetFunction オブジェクト (Excel)WorksheetFunction object (Excel)
Visual Basic から呼び出すことができる Excel ワークシート関数のコンテナーとして使用されます。Used as a container for Microsoft Excel worksheet functions that can be called from Visual Basic.
例Example
WorksheetFunction オブジェクトを戻すには、Application オブジェクトの WorksheetFunction プロパティを使用します。Use the WorksheetFunction property of the Application object to return the WorksheetFunction object.
次の使用例は、 Min ワークシート関数をセル範囲 A1:C10 に適用した結果を表示します。The following example displays the result of applying the Min worksheet function to the range A1:C10.
Set myRange = Worksheets("Sheet1").Range("A1:C10")
answer = Application.WorksheetFunction.Min(myRange)
MsgBox answer
この例は、CountA ワークシート関数を使用して、列 A 内のセルのうち値が含まれるセルの数を確認します。This example uses the CountA worksheet function to determine how many cells in column A contain a value. この例では、列 A 内の値として文字が含まれている必要があります。For this example, the values in column A should be text. この例は、列 A 内の各値に対してスペル チェックを実行し、値のスペルが誤っている場合は文字 "Wrong" を列 B に挿入し、それ以外の場合は文字 "OK" を列 B に挿入します。This example does a spell check on each value in column A, and if the value is spelled incorrectly, inserts the text "Wrong" into column B; otherwise, it inserts the text "OK" into column 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
メソッドMethods
- AccrIntAccrInt
- AccrIntMAccrIntM
- AcosAcos
- AcoshAcosh
- AcotAcot
- AcothAcoth
- AggregateAggregate
- AmorDegrcAmorDegrc
- AmorLincAmorLinc
- AndAnd
- ArabicArabic
- AscAsc
- AsinAsin
- AsinhAsinh
- Atan2Atan2
- AtanhAtanh
- AveDevAveDev
- AverageAverage
- AverageIfAverageIf
- AverageIfsAverageIfs
- BahtTextBahtText
- BaseBase
- BesselIBesselI
- BesselJBesselJ
- BesselKBesselK
- BesselYBesselY
- Beta_DistBeta_Dist
- Beta_InvBeta_Inv
- BetaDistBetaDist
- BetaInvBetaInv
- Bin2DecBin2Dec
- Bin2HexBin2Hex
- Bin2OctBin2Oct
- Binom_DistBinom_Dist
- Binom_Dist_RangeBinom_Dist_Range
- Binom_InvBinom_Inv
- BinomDistBinomDist
- BitandBitand
- BitlshiftBitlshift
- BitorBitor
- BitrshiftBitrshift
- BitxorBitxor
- CeilingCeiling
- Ceiling_MathCeiling_Math
- Ceiling_PreciseCeiling_Precise
- ChiDistChiDist
- ChiInvChiInv
- ChiSq_DistChiSq_Dist
- ChiSq_Dist_RTChiSq_Dist_RT
- ChiSq_InvChiSq_Inv
- ChiSq_Inv_RTChiSq_Inv_RT
- ChiSq_TestChiSq_Test
- ChiTestChiTest
- ChooseChoose
- CleanClean
- CombinCombin
- CombinaCombina
- ComplexComplex
- ConfidenceConfidence
- Confidence_NormConfidence_Norm
- Confidence_TConfidence_T
- ConvertConvert
- CorrelCorrel
- CoshCosh
- CotCot
- CothCoth
- CountCount
- CountACountA
- CountBlankCountBlank
- CountIfCountIf
- CountIfsCountIfs
- CoupDayBsCoupDayBs
- CoupDaysCoupDays
- CoupDaysNcCoupDaysNc
- CoupNcdCoupNcd
- CoupNumCoupNum
- CoupPcdCoupPcd
- CovarCovar
- Covariance_PCovariance_P
- Covariance_SCovariance_S
- CritBinomCritBinom
- CscCsc
- CschCsch
- CumIPmtCumIPmt
- CumPrincCumPrinc
- DAverageDAverage
- 日Days
- Days360Days360
- DbDb
- DbcsDbcs
- DCountDCount
- DCountADCountA
- DdbDdb
- Dec2BinDec2Bin
- Dec2HexDec2Hex
- Dec2OctDec2Oct
- DecimalDecimal
- DegreesDegrees
- 差分Delta
- DevSqDevSq
- DGetDGet
- DiscDisc
- DMaxDMax
- DMinDMin
- DollarDollar
- DollarDeDollarDe
- DollarFrDollarFr
- DProductDProduct
- DStDevDStDev
- DStDevPDStDevP
- DSumDSum
- 期間Duration
- DVarDVar
- DVarPDVarP
- EDateEDate
- EffectEffect
- EncodeUrlEncodeUrl
- EoMonthEoMonth
- ErfErf
- Erf_PreciseErf_Precise
- ErfCErfC
- ErfC_PreciseErfC_Precise
- EvenEven
- Expon_DistExpon_Dist
- ExponDistExponDist
- F_DistF_Dist
- F_Dist_RTF_Dist_RT
- F_InvF_Inv
- F_Inv_RTF_Inv_RT
- F_TestF_Test
- FactFact
- FactDoubleFactDouble
- FDistFDist
- FilterXMLFilterXML
- FindFind
- FindBFindB
- FInvFInv
- FisherFisher
- FisherInvFisherInv
- FixedFixed
- FloorFloor
- Floor_MathFloor_Math
- Floor_PreciseFloor_Precise
- ForecastForecast
- Forecast_ETSForecast_ETS
- Forecast_ETS_ConfIntForecast_ETS_ConfInt
- Forecast_ETS_SeasonalityForecast_ETS_Seasonality
- Forecast_ETS_STATForecast_ETS_STAT
- Forecast_LinearForecast_Linear
- FrequencyFrequency
- FTestFTest
- FvFv
- FVScheduleFVSchedule
- GammaGamma
- Gamma_DistGamma_Dist
- Gamma_InvGamma_Inv
- GammaDistGammaDist
- GammaInvGammaInv
- GammaLnGammaLn
- GammaLn_PreciseGammaLn_Precise
- GaussGauss
- GcdGcd
- GeoMeanGeoMean
- GeStepGeStep
- GrowthGrowth
- HarMeanHarMean
- Hex2BinHex2Bin
- Hex2DecHex2Dec
- Hex2OctHex2Oct
- HLookupHLookup
- HypGeom_DistHypGeom_Dist
- HypGeomDistHypGeomDist
- IfErrorIfError
- IfNaIfNa
- ImAbsImAbs
- ImaginaryImaginary
- ImArgumentImArgument
- ImConjugateImConjugate
- ImCosImCos
- ImCoshImCosh
- ImCotImCot
- ImCscImCsc
- ImCschImCsch
- ImDivImDiv
- ImExpImExp
- ImLnImLn
- ImLog10ImLog10
- ImLog2ImLog2
- ImPowerImPower
- ImProductImProduct
- ImRealImReal
- ImSecImSec
- ImSechImSech
- ImSinImSin
- ImSinhImSinh
- ImSqrtImSqrt
- ImSubImSub
- ImSumImSum
- ImTanImTan
- インデックスIndex
- InterceptIntercept
- IntRateIntRate
- IpmtIpmt
- IrrIrr
- IsErrIsErr
- IsErrorIsError
- IsEvenIsEven
- IsFormulaIsFormula
- IsLogicalIsLogical
- IsNAIsNA
- IsNonTextIsNonText
- IsNumberIsNumber
- ISO_CeilingISO_Ceiling
- IsOddIsOdd
- IsoWeekNumIsoWeekNum
- IspmtIspmt
- IsTextIsText
- KurtKurt
- LargeLarge
- LcmLcm
- LinEstLinEst
- LnLn
- LogLog
- Log10Log10
- LogEstLogEst
- LogInvLogInv
- LogNorm_DistLogNorm_Dist
- LogNorm_InvLogNorm_Inv
- LogNormDistLogNormDist
- LookupLookup
- MatchMatch
- MaxMax
- MDetermMDeterm
- MDurationMDuration
- MedianMedian
- MinMin
- MInverseMInverse
- MIrrMIrr
- MMultMMult
- ModeMode
- Mode_MultMode_Mult
- Mode_SnglMode_Sngl
- MRoundMRound
- MultiNomialMultiNomial
- MunitMunit
- NegBinom_DistNegBinom_Dist
- NegBinomDistNegBinomDist
- NetworkDaysNetworkDays
- NetworkDays_IntlNetworkDays_Intl
- NominalNominal
- Norm_DistNorm_Dist
- Norm_InvNorm_Inv
- Norm_S_DistNorm_S_Dist
- Norm_S_InvNorm_S_Inv
- NormDistNormDist
- NormInvNormInv
- NormSDistNormSDist
- NormSInvNormSInv
- NPerNPer
- NpvNpv
- NumberValueNumberValue
- Oct2BinOct2Bin
- Oct2DecOct2Dec
- Oct2HexOct2Hex
- OddOdd
- OddFPriceOddFPrice
- OddFYieldOddFYield
- OddLPriceOddLPrice
- OddLYieldOddLYield
- OrOr
- PDurationPDuration
- PearsonPearson
- PercentilePercentile
- Percentile_ExcPercentile_Exc
- Percentile_IncPercentile_Inc
- PercentRankPercentRank
- PercentRank_ExcPercentRank_Exc
- PercentRank_IncPercentRank_Inc
- PermutPermut
- PermutationaPermutationa
- PhiPhi
- PhoneticPhonetic
- PiPi
- PmtPmt
- PoissonPoisson
- Poisson_DistPoisson_Dist
- 電源Power
- PpmtPpmt
- PricePrice
- PriceDiscPriceDisc
- PriceMatPriceMat
- ProbProb
- ProductProduct
- ProperProper
- PvPv
- QuartileQuartile
- Quartile_ExcQuartile_Exc
- Quartile_IncQuartile_Inc
- QuotientQuotient
- RadiansRadians
- RandBetweenRandBetween
- RankRank
- Rank_AvgRank_Avg
- Rank_EqRank_Eq
- RateRate
- ReceivedReceived
- ReplaceReplace
- ReplaceBReplaceB
- ReptRept
- RomanRoman
- RoundRound
- RoundDownRoundDown
- RoundUpRoundUp
- RriRri
- RSqRSq
- RTDRTD
- 検索Search
- SearchBSearchB
- SecSec
- SechSech
- SeriesSumSeriesSum
- SinhSinh
- SkewSkew
- Skew_pSkew_p
- SlnSln
- SlopeSlope
- SmallSmall
- SqrtPiSqrtPi
- StandardizeStandardize
- StDevStDev
- StDev_PStDev_P
- StDev_SStDev_S
- StDevPStDevP
- StEyxStEyx
- SubstituteSubstitute
- SubtotalSubtotal
- SumSum
- SumIfSumIf
- SumIfsSumIfs
- SumProductSumProduct
- SumSqSumSq
- SumX2MY2SumX2MY2
- SumX2PY2SumX2PY2
- SumXMY2SumXMY2
- SydSyd
- T_DistT_Dist
- T_Dist_2TT_Dist_2T
- T_Dist_RTT_Dist_RT
- T_InvT_Inv
- T_Inv_2TT_Inv_2T
- T_TestT_Test
- TanhTanh
- TBillEqTBillEq
- TBillPriceTBillPrice
- TBillYieldTBillYield
- TDistTDist
- テキストText
- TInvTInv
- TransposeTranspose
- TrendTrend
- TrimTrim
- TrimMeanTrimMean
- TTestTTest
- UnicharUnichar
- UnicodeUnicode
- USDollarUSDollar
- VarVar
- Var_PVar_P
- Var_SVar_S
- VarPVarP
- VdbVdb
- VLookupVLookup
- WebServiceWebService
- WeekdayWeekday
- WeekNumWeekNum
- WeibullWeibull
- Weibull_DistWeibull_Dist
- WorkDayWorkDay
- WorkDay_IntlWorkDay_Intl
- XirrXirr
- XnpvXnpv
- XorXor
- YearFracYearFrac
- YieldDiscYieldDisc
- YieldMatYieldMat
- Z_TestZ_Test
- ZTestZTest
プロパティProperties
関連項目See also
- Excel の Visual Basic マクロでワークシート関数を使用するUsing a worksheet function in a Visual Basic macro in Excel
- Excel オブジェクト モデル リファレンスExcel Object Model Reference
サポートとフィードバックSupport and feedback
Office VBA またはこの説明書に関するご質問やフィードバックがありますか?Have questions or feedback about Office VBA or this documentation? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.