LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Select Case Behaving Oddly

I have been creating a spreadsheet that copies info from an User Form into
the appropriate row of sheet.
And all was working well until the other day.

I have not made any changes to the code in question, so I am confused as to
what is happening.
The fields in the User Form to be saved have Numeric Tags added to them, and
all work except for the field with the Tag number 6.
The Code is at the bottom of the post.
It should follow the Case Else code, but instead follows the Case 51 To 65.
I cant work out why
And the company now wants to roll out the sheet across multiple offices, so
I need to get this fixed rather sharpish.

Any help will be very much appreciated

Thanks

Kris
===============================================

The Offending Code!!

With dbs_SOR.Range("A1")
'Loop through Controls
For Each ctlInfo In Me.Controls
'if Tag is Numeric, it is a Data Entry Control
If IsNumeric(ctlInfo.Tag) Then
'Send Data to the worksheet
Select Case ctlInfo.Tag
Case 3
.Offset(lRow - 1, ctlInfo.Tag).Value = "01-" &
ctlInfo.Value
Case 22 To 33
If ctlInfo.Value = True Then
.Offset(lRow - 1, ctlInfo.Tag).Value = 1
Else
.Offset(lRow - 1, ctlInfo.Tag).Value = 0
End If
Case 41 To 44
If ctlInfo.Value = True Then
.Offset(lRow - 1, 11).Value = ctlInfo.Caption
End If
Case 51 To 65
If ctlInfo.Value = True Then
.Offset(lRow - 1, 12).Value = ctlInfo.Caption
End If
Case Else
.Offset(lRow - 1, ctlInfo.Tag).Value = ctlInfo.Value
End Select
End If
Next ctlInfo
End With


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
OFFSET behaving oddly Ryan Poth Excel Worksheet Functions 2 May 30th 06 07:29 AM
Need help on Select Case Susan Hayes Excel Worksheet Functions 1 November 3rd 04 10:25 PM
=ISODD Behaving Oddly Craig[_15_] Excel Programming 5 April 30th 04 08:59 PM


All times are GMT +1. The time now is 06:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"