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: 287
Default Select Case

Hello All,

I have the following Code giving me some problems. Can anyone help? I have
little knowledge of VBA. Thanks in advance.

Public Sub Username2Line()



Dim LastRowWS As Long
LastRowWS = Cells(Rows.Count, "A").End(xlUp).Row


Do Until ActiveCell = ("H" & (LastRowWS))
Select Case ActiveCell.Value

Case "MFG1"

If ActiveCell.Offset(0, 1).Value = "10FS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
ActiveCell.Offset(0, 2).Value = "Incorrect Location"
End If

Case "MFG11"

If ActiveCell.Offset(0, 1).Value = "80FS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
ActiveCell.Offset(0, 2).Value = "Incorrect Location"
End If

Case "MFG15"

If ActiveCell.Offset(0, 1).Value = "VTFS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
If ActiveCell.Offset(0, 1).Value = "TSFS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
If ActiveCell.Offset(0, 1).Value = "LUMFS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
ActiveCell.Offset(0, 2).Value = "Incorrect Location"
End If

Case "MFG16"

If ActiveCell.Offset(0, 1).Value = "STGFS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
ActiveCell.Offset(0, 2).Value = "Incorrect Location"
End If

Case "MFG17"

If ActiveCell.Offset(0, 1).Value = "35FS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
ActiveCell.Offset(0, 2).Value = "Incorrect Location"
End If

Case "MFG18"

If ActiveCell.Offset(0, 1).Value = "DPFS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
ActiveCell.Offset(0, 2).Value = "Incorrect Location"
End If

Case "MFG4"

If ActiveCell.Offset(0, 1).Value = "70FS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
ActiveCell.Offset(0, 2).Value = "Incorrect Location"
End If

Case "MFG5"

If ActiveCell.Offset(0, 1).Value = "VTFS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
ActiveCell.Offset(0, 2).Value = "Incorrect Location"
End If

Case "MFG7"

If ActiveCell.Offset(0, 1).Value = "70FS" Then
ActiveCell.Offset(0, 2).Value = "Correct"
Else
ActiveCell.Offset(0, 2).Value = "Incorrect Location"
End If

Loop


End Select


End Sub
 
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
Can I use Select Case to do this? ChipButtyMan Excel Programming 7 October 19th 08 04:09 PM
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
End Select without Select Case, Block If without End If errors Atreides Excel Programming 12 November 17th 06 05:10 PM
Case Select Bill Excel Programming 10 January 8th 05 05:02 PM


All times are GMT +1. The time now is 07:10 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"