|
|
Title | X \ COL_WID |
Keywords | quick question, quiz |
Categories | Tips and Tricks |
|
|
Const COL_WID = 1.25
Const ROW_HGT = 2.5
Dim row As Integer
Dim col As Integer
Dim X As Single
Dim Y As Single
' Get the cell's location.
col = 7
row = 3
X = col * COL_WID
Y = row * ROW_HGT
' Verify the row and column.
Debug.Print col & " = " & X \ COL_WID
Debug.Print row & " = " & Y \ ROW_HGT
|
|
This code produces the output:
7 = 9
3 = 4
- Why don't the calculated row and col values match the original values?
- Compare the data type "promotion" performed by Visual Basic in the following two statements:
X = col * COL_WID
Debug.Print col & " = " & X \ COL_WID
- What are the correct Debug.Print statements?
|
|