Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Variable text manipulation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gwoodby@gmail.com - 29 Nov 2007 16:36 GMT
Whats the easiest way to do this I am having a hard time trying to
figure this one out :( Please Help!!!

Private Function CheckedSummons(StringtoCheck As String)
Dim cnt As Integer
Dim NewText As String
Dim SummonsInformation as String
For cnt = 25 To 41
   NewText = Range("A6:AX4500").Find(StringtoCheck,
LookIn:=xlValues).Offset(0, cnt)
       If NewText <> "" Then
           ' If Newtext is  not nothing then Save Whats Already in
SummonsInformation, Add a NewLine
           '  and Add Newtext to SummonsInformation
         end if
next cnt

End Function
Bernie Deitrick - 29 Nov 2007 17:38 GMT
Private Function CheckedSummons(StringtoCheck As String) As String
Dim cnt As Integer
Dim NewText As String
Dim SummonsInformation As String
Dim rngFound As Range

Set rngFound = Range("A6:AX4500").Find(StringtoCheck, _
                                      LookIn:=xlValues)

For cnt = 25 To 41
  NewText = rngFound.Offset(0, cnt).Value
  If NewText <> "" Then
     If SummonsInformation = "" Then
        SummonsInformation = NewText
     Else
        SummonsInformation = SummonsInformation & vbLf & NewText
     End If
  End If
Next cnt

CheckedSummons = SummonsInformation

End Function

HTH,
Bernie
MS Excel MVP

> Whats the easiest way to do this I am having a hard time trying to
> figure this one out :( Please Help!!!
[quoted text clipped - 14 lines]
>
> End Function
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.