Listing A Procedure That Tests the Evaluate Function

Sub EvaluateTest()

Dim columnLetter As String Dim rowNumber As String Dim cellAddress As String

' Activate the "Test Data" worksheet

Worksheets("Test Data").Activate

1 Get the value in cell A1

columnLetter = [A1].Value

' Get the value in cell B1

rowNumber = [B1].Value

' Concatenate the two values and then display the message cellAddress = columnLetter & rowNumber MsgBox "The value in cell " & cellAddress & " is " & _ Application.Evaluate(cellAddress)

End Sub

ยก^ The code used in this chapter's examples can be found on my website at the following address:


0 0

Post a comment