Birdy01962
New Member
- Joined
- Jun 27, 2016
- Messages
- 25
I have a spreadsheet Database that is created by a userform. I have 18 textboxes on userform that are divided into 2 x 9. Each textbox is named H1.....H18. once all 18 textboxes are completed they need to be transferred to 2 different sheets. first 9 (H1 - H9) to "front 9" H10 - 18 to "Back 9". I have the following code which works fine for first 9:- and pastes to "front 9" sheet
For ColNum = H1Col To H9Col
' IndexNum = ColNum - H1Col + 1
' If (Me(IndexNum)) = "" Then
' Me(IndexNum) = 0
' Else
' Cells(RowNumName, ColNum) = CInt(NewScore18(IndexNum))
' End If
'Next ColNum
However using the same code for the back 9
For ColNum = H10Col To H18Col
' IndexNum = ColNum - H1Col + 1
' If (Me(IndexNum)) = "" Then
' Me(IndexNum) = 0
' Else
' Cells(RowNumName, ColNum) = CInt(NewScore18(IndexNum))
' End If
'Next ColNum
always returns H1-9 values not H10 - H18 as needed.
If I replace " = CInt(NewScore18(IndexNum))" above with cell H10 value it does return H10 value but how do I index H10 to H11 value etc that gets pasted into the correct shreadsheet.
I do not understand the CInt instruction in this context.
Any guidance would be appreciated
For ColNum = H1Col To H9Col
' IndexNum = ColNum - H1Col + 1
' If (Me(IndexNum)) = "" Then
' Me(IndexNum) = 0
' Else
' Cells(RowNumName, ColNum) = CInt(NewScore18(IndexNum))
' End If
'Next ColNum
However using the same code for the back 9
For ColNum = H10Col To H18Col
' IndexNum = ColNum - H1Col + 1
' If (Me(IndexNum)) = "" Then
' Me(IndexNum) = 0
' Else
' Cells(RowNumName, ColNum) = CInt(NewScore18(IndexNum))
' End If
'Next ColNum
always returns H1-9 values not H10 - H18 as needed.
If I replace " = CInt(NewScore18(IndexNum))" above with cell H10 value it does return H10 value but how do I index H10 to H11 value etc that gets pasted into the correct shreadsheet.
I do not understand the CInt instruction in this context.
Any guidance would be appreciated