what does cells(Val(txtID) + 4, 7).Activate mean

dennistky
04-06-2003, 03:00 AM
Dear VB expert,

I am currently trying to understand the meaning of Val(txtID)? Can somebody enlighten me? Below is part of the program which I am stuck?


Regards
Dennis Tan


Private Sub txtID_Change()
Dim Sift%
Cells(Val(txtID) + 4, 7).Activate ' Move Cell Position
lblSend = Cells(Val(txtID) + 4, 6).Value ' Show Send Comment
txtSend = Cells(Val(txtID) + 4, 7).Value ' Show Sended Contents
txtWait2 = Val(Cells(Val(txtID) + 4, 8).Value) ' Show Wait
If Cells(Val(txtID) + 4, 9).Value = "None" Then
chkResive.Value = 1 'If there is no Responce
Else
chkResive.Value = 0 'If there is any Responce
End If
End Sub

Iceplug
04-06-2003, 06:42 AM
Val(txtId) converts the text inside of the TextBox called txtID into a number for use in mathematical operations :).
As you can see, it is added to four... moved four rows down, and is at the seventh column 'G'.

Mill
04-07-2003, 06:23 AM
txtSend = Cells(Val(txtID) + 4, 7).Value ' Show Sended Contents


As Iceplug said, the Val function converts the text of txtID to a numeric value.

The Cells keyword looks like Cells(Row, Col). So you are looking at the cell that is in row (txtID + 4) and column 7 (or 'G', as was mentioned above). Then, whatever is in that cell gets put into txtSend.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum