LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Split question in XL2003

Many thanks.

I now have the following to get me started:

Dim iloc As Integer, firstNum As String
Dim ComplexPageNo As Boolean, SimplePageNo As Boolean
iloc = InStr(FirstPageNumber, "/")
If iloc < 0 Then
'user wants a complex page number structure
ComplexPageNo = True
'so make sure first page is 1
firstNum = CLng(Left(FirstPageNumber, iloc - 1)) & "/" & "1"
Else
'user wants a simple page number structure
SimplePageNo = True
firstNum = CLng(FirstPageNumber)
'force the first simple page number to 1
If firstNum < 1 Then
firstNum = 1
End If
End If

If ComplexPageNo = True Then
varr = Split(firstNum, "/")
Dim True1stPageNr As String
True1stPageNr = varr(0) & "/" & varr(1)
ElseIf SimplePageNr = True Then
Dim True1stPageNr As Integer
True1stPageNr = firstNum
End If

Regards.

"Tom Ogilvy" wrote in message
...
iloc = Instr(FirstPageNumber,"/")
if iloc < 0 then
firstNum = clng(left(FirstPageNumber,iloc-1))
Else
firstNum = clng(FirstPageNumber)
End if


--
Regards,
Tom Ogilvy

"S G Booth" wrote in message
...
I would like to test a cell's value to see if it takes the form
?/? where ? should simply be integers.....something like
2/1 or 27/1 or 256/1

The requirement is for the value to be in the form
integer/1

I have: varr = Split(FirstPageNumber, "/")
where FirstPageNumber holds the value of the cell in
question (as a String). This works (sort of) but not in all
cases (eg when "/" is missing).

I need to do this test just once for each sheet, and wish
to get the integer value.

Would appreciate some help, please.

Regards.






 
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
A/B split testing question Tony Excel Discussion (Misc queries) 1 March 26th 11 12:43 AM
Very basic pivottable question (XL2003) Keith R Excel Discussion (Misc queries) 1 August 9th 07 02:23 PM
Split UPC Question MikeD1224 Excel Discussion (Misc queries) 2 February 16th 07 07:29 PM
Split & Trim question Stuart[_5_] Excel Programming 1 March 2nd 04 01:33 AM
Right & Split question Stuart[_5_] Excel Programming 8 February 29th 04 07:53 AM


All times are GMT +1. The time now is 09:57 PM.

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"