Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default STRING SUM UNTIL

in A column i have many records as string like

(A)
one
two
three
four five
ten
ten nine
nine
.....
.....
.....
etc

with vba i would find all the SUM string that have at least "x"
characters including spaces between the strings, for example if i
would like to find the sum string with "8" characters at least, I'll
get in column B those SUM strings like follow

(B)
one nine
two nine
ten nine

where all the found strings have 8 characters

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 329
Default STRING SUM UNTIL

Hi ancora,

Try:
Sub Test()
Dim i as Long
Dim j as Long
With ActiveSheet
For i = 1 To .UsedRange.Rows.Count
If Len(.Range("A" & i)) 7 Then
j = j + 1
.Range("B" & j).Value = .Range("A" & i).Value
End If
Next
End With
End Sub

Cheers

--
macropod
[MVP - Microsoft Word]
-------------------------

"ancora" wrote in message ups.com...
in A column i have many records as string like

(A)
one
two
three
four five
ten
ten nine
nine
....
....
....
etc

with vba i would find all the SUM string that have at least "x"
characters including spaces between the strings, for example if i
would like to find the sum string with "8" characters at least, I'll
get in column B those SUM strings like follow

(B)
one nine
two nine
ten nine

where all the found strings have 8 characters

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default STRING SUM UNTIL

On 14 Mar, 11:56, "macropod" wrote:
Hi ancora,

Try:
Sub Test()
Dim i as Long
Dim j as Long
With ActiveSheet
For i = 1 To .UsedRange.Rows.Count
If Len(.Range("A" & i)) 7 Then
j = j + 1
.Range("B" & j).Value = .Range("A" & i).Value
End If
Next
End With
End Sub

Cheers

--
macropod
[MVP - Microsoft Word]
-------------------------



"ancora" wrote in oglegroups.com...
in A column i have many records asstringlike


(A)
one
two
three
four five
ten
ten nine
nine
....
....
....
etc


with vba i would find all theSUMstringthat have at least "x"
characters including spaces between the strings, for example if i
would like to find thesumstringwith "8" characters at least, I'll
get in column B thoseSUMstrings like follow


(B)
one nine
two nine
ten nine


where all the found strings have 8 characters- Nascondi testo tra virgolette -


- Mostra testo tra virgolette -


thanks a lot for your help
but it works only taking string with 8 characters and past to column b
I want to find all the combination which the string lenght is 8
characters
like my example, pls help again

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 329
Default STRING SUM UNTIL

Hi ancora,

If you want to find an exact number of characters, change the line:
If Len(.Range("A" & i)) 7 Then
to
If Len(.Range("A" & i)) =8 Then
(for 8 characters)

Cheers

--
macropod
[MVP - Microsoft Word]
-------------------------

"ancora" wrote in message ups.com...
On 14 Mar, 11:56, "macropod" wrote:
Hi ancora,

Try:
Sub Test()
Dim i as Long
Dim j as Long
With ActiveSheet
For i = 1 To .UsedRange.Rows.Count
If Len(.Range("A" & i)) 7 Then
j = j + 1
.Range("B" & j).Value = .Range("A" & i).Value
End If
Next
End With
End Sub

Cheers

--
macropod
[MVP - Microsoft Word]
-------------------------



"ancora" wrote in oglegroups.com...
in A column i have many records asstringlike


(A)
one
two
three
four five
ten
ten nine
nine
....
....
....
etc


with vba i would find all theSUMstringthat have at least "x"
characters including spaces between the strings, for example if i
would like to find thesumstringwith "8" characters at least, I'll
get in column B thoseSUMstrings like follow


(B)
one nine
two nine
ten nine


where all the found strings have 8 characters- Nascondi testo tra virgolette -


- Mostra testo tra virgolette -


thanks a lot for your help
but it works only taking string with 8 characters and past to column b
I want to find all the combination which the string lenght is 8
characters
like my example, pls help again

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
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
Replace Hyperlink Addresses Help 'Dim OldStr As String, NewStr As String Ron[_14_] Excel Programming 6 January 23rd 07 07:38 PM
Importing Long String - String Manipulation (INVRPT) (EDI EANCOM 96a) Brian Excel Programming 3 February 9th 06 03:38 PM
Importing Long String - String Manipulation (EDI EANCOM 96a) Brian Excel Programming 6 February 9th 06 12:27 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


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