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: 3
Default Seeking some VB code help.

I'm trying to do the following:

iGroupNum = variable

IF (the right 2 digits of iGroupNum) = "01" or "02" then
If (the right 2 of iGroupNum) = "01" then
iGroupNum = whatever is left minus the 2 right digits (i.e.
3001 would be igroupnum= 30) * 2
Else If (the right 2 digits of iGroupNum) = "02" then
iGroupNumb= whatever is left minus the 2 right digits * 2 + 1
End If
Else (the right 2 digits of iGroupNum < "01" or "02" then
iGroupNum = iGroupNum* 2
End If

Essentially, I'm trying to move cells from one page with a designated
group number to another page. They will go into every other row except
for when the right 2 digits of the designated group number is "01" or
"02". In this case they will end up in consecutive rows.

So far I have:

If Right(iGroupNum, 2) = "01" Or "02" Then
If Right(iGroupNum, 2) = "01" Then
iGroupNum = Left(iGroupNum, Len(iGroupNum) - 2) * 2
Else
iGroupNum = iGroupNum * 2 + 1
End If
End If

If Right(iGroupNum, 2) < "01" Or "02" Then
iGroupNum = iGroupNum
End If

Unfortunately the code is going into the first IF statement even if
iGroupNum = 2 (should only go in if it were 201 or 202)
End If

Help?
Newbie VB gal.

 
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
seeking help angel Excel Worksheet Functions 2 July 10th 08 07:48 AM
Seeking the character code for entering a Hard Return in a cell? JKing Excel Discussion (Misc queries) 2 June 4th 08 11:06 PM
Seeking Help with a forumal. [email protected] Excel Programming 2 April 7th 06 10:39 PM
Seeking help from a GURU usf97j4x4 Excel Worksheet Functions 5 January 11th 06 05:17 PM
Seeking example code Karl Excel Programming 2 September 29th 04 02:42 PM


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