Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default help statement unfinished

Hi,

I've come up with this formula so far, but it needs to make a loop,I think
with an If statement. Also the string to be found is always in column A. I
didn't put it in there yet. Anyone?


Cells.Find(What:="[bestandnaam*", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
Selection.Offset(1, 5).Select
ActiveSheet.Paste
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default help statement unfinished

Will this work for you? I removed the bracket ([) and replaced it
with a single character wild card.
Sub this()
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "A").Text Like "?bestandnaam*" Then
Range(Cells(i, "A"), Cells(i, "A").End(xlToRight)).Cut _
Destination:=Cells(i, "A").Offset(1, 5)
End If
Next i
End Sub
Jootje wrote:
Hi,

I've come up with this formula so far, but it needs to make a loop,I think
with an If statement. Also the string to be found is always in column A. I
didn't put it in there yet. Anyone?


Cells.Find(What:="[bestandnaam*", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
Selection.Offset(1, 5).Select
ActiveSheet.Paste


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default help statement unfinished

Sub ABCD()
Range("a1").Select
Do
Set rng = Columns(1).Find(What:="[bestandnaam*", _
After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not rng Is Nothing Then
rng.Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
Selection.Offset(1, 5).Select
ActiveSheet.Paste
Else
Debug.Print "not found"
End If
Cells(ActiveCell.Row, 1).Select
Loop Until rng Is Nothing

End Sub
--
Regards,
Tom Ogilvy


"Jootje" wrote:

Hi,

I've come up with this formula so far, but it needs to make a loop,I think
with an If statement. Also the string to be found is always in column A. I
didn't put it in there yet. Anyone?


Cells.Find(What:="[bestandnaam*", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
Selection.Offset(1, 5).Select
ActiveSheet.Paste

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default help statement unfinished

Thanks! They both work very well for me!


"Tom Ogilvy" wrote:

Sub ABCD()
Range("a1").Select
Do
Set rng = Columns(1).Find(What:="[bestandnaam*", _
After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not rng Is Nothing Then
rng.Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
Selection.Offset(1, 5).Select
ActiveSheet.Paste
Else
Debug.Print "not found"
End If
Cells(ActiveCell.Row, 1).Select
Loop Until rng Is Nothing

End Sub
--
Regards,
Tom Ogilvy


"Jootje" wrote:

Hi,

I've come up with this formula so far, but it needs to make a loop,I think
with an If statement. Also the string to be found is always in column A. I
didn't put it in there yet. Anyone?


Cells.Find(What:="[bestandnaam*", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
Selection.Offset(1, 5).Select
ActiveSheet.Paste

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
IF statement inside a SUMIF statement.... or alternative method Sungibungi Excel Worksheet Functions 3 December 4th 09 06:22 PM
Reconcile Bank statement & Credit card statement & accounting data Bklynhyc Excel Worksheet Functions 0 October 7th 09 09:07 PM
Embedding an OR statement in an IF statement efficiently Chatnoir11 Excel Discussion (Misc queries) 4 February 2nd 09 08:12 PM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM


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