Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help on nested loops

Hi!
I would like to get any helpful suggestion how to approach the following
problem. If I have a single string made of the sequence of capital
letters with no spaces, that may be input by user, and would ordinarily
be n characters long, where n=5 to 100 or even more, different each
time. How to create an Excel spreadsheet or an array, containing all
possible combinations of deletions, where deletion spaces would
gradually increase from 1 to n-1, such that the gradually shortet string
would be created, as schematically outlined below:

ABCDEGTWESRADCRFRIEOPTY
ABCDEGTWESRADCRFRIEOPT
ABCDEGTWESRADCRFRIEOP Y '1 DELETIONS, STARTING FROM RIGHT
ABCDEGTWESRADCRFRIEO TY
ABCDEGTWESRADCRFRIE PTY
ABCDEGTWESRADCRFRI PTY
...................................
..................................
ABCDEGTWESRADCRFRIEO Y
ABCDEGTWESRADCRFRIE P Y '2 DELETIONS, STARTING FROM RIGHT
ABCDEGTWESRADCRFRI OP Y ' FIRST AT POSITION 2, 2ND STARTS AT POS.3 etc
ABCDEGTWESRADCRFR EOP Y
.................................................. ...............
.................................................. ...........
ABCDEGTWESRADCRFRIEOP Y
ABCDEGTWESRADCRFRIE Y ' 3 DELETIONS, STARTING FROM RIGHT
ABCDEGTWESRADCRFRI O Y
.................................................. ........
.................................................. .......
A Y ' n-2
DELETIONS, (N-2)TH DELETION AT POSITION 2 FROM LEFT
B Y ' n-2
DELETIONS, (N-2)TH DELETION AT POSITION 1 FROM LEFT

At first I tought of nested loops, but since the lenght of the string
would be different in each case and so would a number of iterations how
to do it? It would probably be n-1 iterations, different each time. Any
alternative to nested loops?

JasL




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help on nested loops

From your description I have no idea what you are trying to do, but you can
handle variable string lengths by using Len, such as

For i = 1 To Len(myString)
etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Lukszo" wrote in message
...
Hi!
I would like to get any helpful suggestion how to approach the following
problem. If I have a single string made of the sequence of capital
letters with no spaces, that may be input by user, and would ordinarily
be n characters long, where n=5 to 100 or even more, different each
time. How to create an Excel spreadsheet or an array, containing all
possible combinations of deletions, where deletion spaces would
gradually increase from 1 to n-1, such that the gradually shortet string
would be created, as schematically outlined below:

ABCDEGTWESRADCRFRIEOPTY
ABCDEGTWESRADCRFRIEOPT
ABCDEGTWESRADCRFRIEOP Y '1 DELETIONS, STARTING FROM RIGHT
ABCDEGTWESRADCRFRIEO TY
ABCDEGTWESRADCRFRIE PTY
ABCDEGTWESRADCRFRI PTY
..................................
.................................
ABCDEGTWESRADCRFRIEO Y
ABCDEGTWESRADCRFRIE P Y '2 DELETIONS, STARTING FROM RIGHT
ABCDEGTWESRADCRFRI OP Y ' FIRST AT POSITION 2, 2ND STARTS AT POS.3 etc
ABCDEGTWESRADCRFR EOP Y
.................................................. ..............
.................................................. ..........
ABCDEGTWESRADCRFRIEOP Y
ABCDEGTWESRADCRFRIE Y ' 3 DELETIONS, STARTING FROM RIGHT
ABCDEGTWESRADCRFRI O Y
.................................................. .......
.................................................. ......
A Y ' n-2
DELETIONS, (N-2)TH DELETION AT POSITION 2 FROM LEFT
B Y ' n-2
DELETIONS, (N-2)TH DELETION AT POSITION 1 FROM LEFT

At first I tought of nested loops, but since the lenght of the string
would be different in each case and so would a number of iterations how
to do it? It would probably be n-1 iterations, different each time. Any
alternative to nested loops?

JasL




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply
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
Help with nested for loops [email protected] Excel Discussion (Misc queries) 5 May 2nd 07 05:30 PM
Help with nested for loops [email protected] Excel Worksheet Functions 5 May 2nd 07 05:30 PM
Max limit of 7 nested loops Subu Excel Worksheet Functions 2 May 28th 05 02:14 PM
Nested loops?? CG Rosén Excel Programming 1 June 22nd 04 08:07 PM
RANGE & NESTED LOOPS jay dean Excel Programming 1 January 29th 04 11:43 PM


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

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

About Us

"It's about Microsoft Excel"