#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 66
Default Loop

Sorry I have to post a new thread. I have not been able to do it the way I've
been told.
I dont know VBA or programming. I make macro by recording steps.
I have this macro which ends with a loop as below. It works, but I need it
to End when there are no more cells with VENDOR ID.
It does the step but ends with the dialog box and I have to click end.

Grateful for help


Do
Range("F:F").Find(What:="Vendor ID", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select

Loop

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Loop

Did you try all the suggestions at your other thread--or one of your other
threads?

Christina wrote:

Sorry I have to post a new thread. I have not been able to do it the way I've
been told.
I dont know VBA or programming. I make macro by recording steps.
I have this macro which ends with a loop as below. It works, but I need it
to End when there are no more cells with VENDOR ID.
It does the step but ends with the dialog box and I have to click end.

Grateful for help

Do
Range("F:F").Find(What:="Vendor ID", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select

Loop

End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Loop

This should be close...

Dim rngFound As Range
Dim strFirst As Range
Dim rngToSearch As Range

Set rngToSearch = Range("F:F")
Set rngFound = rngToSearch.Find(what:="Vendor ID", _
LookAt:=xlWhole, _
LookIn:=xlFormulas, _
MatchCase:=False)
If rngFound Is Nothing Then
MsgBox "Nothing Found"
Else
strFirst = rngFound.Address
Do
With rngFound
.ClearContents
.Offset(1, 0).Copy Destination:=Range(.Offset(1, 0), _
.Offset(1, 0).End(xlDown))
End With
Set rngFound = rngToSearch.FindNext(rngFound)
Loop Until rngFound.Address = strFirst
End If
--
HTH...

Jim Thomlinson


"Christina" wrote:

Sorry I have to post a new thread. I have not been able to do it the way I've
been told.
I dont know VBA or programming. I make macro by recording steps.
I have this macro which ends with a loop as below. It works, but I need it
to End when there are no more cells with VENDOR ID.
It does the step but ends with the dialog box and I have to click end.

Grateful for help


Do
Range("F:F").Find(What:="Vendor ID", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select

Loop

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 66
Default Loop

Yes, I tried all the suggestions, including this recent one.

Thanks

"Dave Peterson" wrote:

Did you try all the suggestions at your other thread--or one of your other
threads?

Christina wrote:

Sorry I have to post a new thread. I have not been able to do it the way I've
been told.
I dont know VBA or programming. I make macro by recording steps.
I have this macro which ends with a loop as below. It works, but I need it
to End when there are no more cells with VENDOR ID.
It does the step but ends with the dialog box and I have to click end.

Grateful for help

Do
Range("F:F").Find(What:="Vendor ID", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select

Loop

End Sub


--

Dave Peterson
.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Loop

I never saw a response--good or bad--to my suggestion.

Christina wrote:

Yes, I tried all the suggestions, including this recent one.

Thanks

"Dave Peterson" wrote:

Did you try all the suggestions at your other thread--or one of your other
threads?

Christina wrote:

Sorry I have to post a new thread. I have not been able to do it the way I've
been told.
I dont know VBA or programming. I make macro by recording steps.
I have this macro which ends with a loop as below. It works, but I need it
to End when there are no more cells with VENDOR ID.
It does the step but ends with the dialog box and I have to click end.

Grateful for help

Do
Range("F:F").Find(What:="Vendor ID", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select

Loop

End Sub


--

Dave Peterson
.


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 66
Default Loop

Thanks, seema I overlooked that one. It worked perfectly. Thanks a lot.

Regards.
Cristina Seawell

"Dave Peterson" wrote:

I never saw a response--good or bad--to my suggestion.

Christina wrote:

Yes, I tried all the suggestions, including this recent one.

Thanks

"Dave Peterson" wrote:

Did you try all the suggestions at your other thread--or one of your other
threads?

Christina wrote:

Sorry I have to post a new thread. I have not been able to do it the way I've
been told.
I dont know VBA or programming. I make macro by recording steps.
I have this macro which ends with a loop as below. It works, but I need it
to End when there are no more cells with VENDOR ID.
It does the step but ends with the dialog box and I have to click end.

Grateful for help

Do
Range("F:F").Find(What:="Vendor ID", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select

Loop

End Sub

--

Dave Peterson
.


--

Dave Peterson
.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Loop

You're welcome.

Christina wrote:

Thanks, seema I overlooked that one. It worked perfectly. Thanks a lot.

Regards.
Cristina Seawell

"Dave Peterson" wrote:

I never saw a response--good or bad--to my suggestion.

Christina wrote:

Yes, I tried all the suggestions, including this recent one.

Thanks

"Dave Peterson" wrote:

Did you try all the suggestions at your other thread--or one of your other
threads?

Christina wrote:

Sorry I have to post a new thread. I have not been able to do it the way I've
been told.
I dont know VBA or programming. I make macro by recording steps.
I have this macro which ends with a loop as below. It works, but I need it
to End when there are no more cells with VENDOR ID.
It does the step but ends with the dialog box and I have to click end.

Grateful for help

Do
Range("F:F").Find(What:="Vendor ID", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlDown, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Select
ActiveCell.ClearContents
ActiveCell.Offset(1, 0).Select
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Select

Loop

End Sub

--

Dave Peterson
.


--

Dave Peterson
.


--

Dave Peterson
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
loop Christina Excel Discussion (Misc queries) 16 March 19th 10 08:29 PM
Do loop Christina Excel Discussion (Misc queries) 0 March 18th 10 03:19 PM
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
while loop Arun Kumar Saha Excel Worksheet Functions 2 June 19th 07 01:31 PM
DO LOOP in VBA Brettjg Excel Discussion (Misc queries) 5 April 24th 07 12:42 AM


All times are GMT +1. The time now is 10:44 PM.

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"