J
Jabba
HI all
I have had the following code (basic I know but hey!) working from a private
sub on a form code (FrmEnterData) before.
I am trying to use the selection in the combobox CmbReason1 using select
case to populate the offset command to enter a "1" in the correct column.
It now only offsets (from the activecell) by one cell - it looks like the
variable 'reason' is returning 0 dfrom the select case.
I've tried moving the code to Module1, making it public, splitting the code
- all sorts but to no avail...
The annoying thing it worked on a different workbook. THAT workbook was
created at work with an older version of Excel - could that be it?
**Just noticed that when i type in 'FrmEnterData' VBA takes out the
capitalisations and leaves 'frmenterdata' - does this mean it doesn't
like/recognise the form?
But it DOES unload it !?!?!?!
Any help would be appreciated thanks
Jabba
***************************
Private Sub CmdContinue_Click()
Dim reason
Select Case frmenterdata.CmbReason1.Value
Case 0
reason = 0
Case 1
reason = 1
Case 2
reason = 2
Case 3
reason = 3
Case 4
reason = 4
Case 5
reason = 5
Case 6
reason = 6
Case 7
reason = 7
Case 8
reason = 8
Case 9
reason = 9
Case 10
reason = 10
Case 11
reason = 11
End Select
ActiveCell.Offset(0, 0).Value = TxtPolNo.Text
ActiveCell.Offset(0, reason + 1).Value = 1 'reason
ActiveCell.Offset(0, 13).Value = "Yes" 'options explained
ActiveCell.Offset(0, 14).Value = "No" 'quote requested
ActiveCell.Offset(0, 15).Value = "Yes" 'continue cancellation
ActiveCell.Offset(0, 16).Value = Date 'continue date
ActiveCell.Offset(0, 17).Value = TxtAddInfo.Text 'add info
ActiveCell.Offset(0, -1).Value = Date
Unload frmenterdata
End Sub
*************************
I have had the following code (basic I know but hey!) working from a private
sub on a form code (FrmEnterData) before.
I am trying to use the selection in the combobox CmbReason1 using select
case to populate the offset command to enter a "1" in the correct column.
It now only offsets (from the activecell) by one cell - it looks like the
variable 'reason' is returning 0 dfrom the select case.
I've tried moving the code to Module1, making it public, splitting the code
- all sorts but to no avail...
The annoying thing it worked on a different workbook. THAT workbook was
created at work with an older version of Excel - could that be it?
**Just noticed that when i type in 'FrmEnterData' VBA takes out the
capitalisations and leaves 'frmenterdata' - does this mean it doesn't
like/recognise the form?
But it DOES unload it !?!?!?!
Any help would be appreciated thanks
Jabba
***************************
Private Sub CmdContinue_Click()
Dim reason
Select Case frmenterdata.CmbReason1.Value
Case 0
reason = 0
Case 1
reason = 1
Case 2
reason = 2
Case 3
reason = 3
Case 4
reason = 4
Case 5
reason = 5
Case 6
reason = 6
Case 7
reason = 7
Case 8
reason = 8
Case 9
reason = 9
Case 10
reason = 10
Case 11
reason = 11
End Select
ActiveCell.Offset(0, 0).Value = TxtPolNo.Text
ActiveCell.Offset(0, reason + 1).Value = 1 'reason
ActiveCell.Offset(0, 13).Value = "Yes" 'options explained
ActiveCell.Offset(0, 14).Value = "No" 'quote requested
ActiveCell.Offset(0, 15).Value = "Yes" 'continue cancellation
ActiveCell.Offset(0, 16).Value = Date 'continue date
ActiveCell.Offset(0, 17).Value = TxtAddInfo.Text 'add info
ActiveCell.Offset(0, -1).Value = Date
Unload frmenterdata
End Sub
*************************