Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Looping Macro Doesn't Work

Help. I can't seem to get this to work.

Sub Macro1()
Do While ActiveCell.Row < 7
Range("A" & ActiveCell.Row - 10).Select
Selection.ClearContents
Loop
End Sub

What did I do wrong?

Thanks
Rob
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Looping Macro Doesn't Work

Nevermind I fig'd where I messed up...

Do While ActiveCell.Row < 7

Should have been

Do While ActiveCell.Row 7

"Rob" wrote:

Help. I can't seem to get this to work.

Sub Macro1()
Do While ActiveCell.Row < 7
Range("A" & ActiveCell.Row - 10).Select
Selection.ClearContents
Loop
End Sub

What did I do wrong?

Thanks
Rob

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Looping Macro Doesn't Work

Rob,
You cannot select a cell in row 0 or any row less than 1. So the
activecell.row MUST be 10 if you want to then select a cell in the
Activecell.Row-10

Your code will still produce an error, say if you were coming from row 8.

"Rob" wrote:

Nevermind I fig'd where I messed up...

Do While ActiveCell.Row < 7

Should have been

Do While ActiveCell.Row 7

"Rob" wrote:

Help. I can't seem to get this to work.

Sub Macro1()
Do While ActiveCell.Row < 7
Range("A" & ActiveCell.Row - 10).Select
Selection.ClearContents
Loop
End Sub

What did I do wrong?

Thanks
Rob

  #4   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Looping Macro Doesn't Work

So I found. I always confuse < . Thanks for the reply.

Rob

"cush" wrote:

Rob,
You cannot select a cell in row 0 or any row less than 1. So the
activecell.row MUST be 10 if you want to then select a cell in the
Activecell.Row-10

Your code will still produce an error, say if you were coming from row 8.

"Rob" wrote:

Nevermind I fig'd where I messed up...

Do While ActiveCell.Row < 7

Should have been

Do While ActiveCell.Row 7

"Rob" wrote:

Help. I can't seem to get this to work.

Sub Macro1()
Do While ActiveCell.Row < 7
Range("A" & ActiveCell.Row - 10).Select
Selection.ClearContents
Loop
End Sub

What did I do wrong?

Thanks
Rob

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
Macro looping? klh84 Excel Worksheet Functions 3 February 26th 10 05:58 PM
Looping Macro KimC Excel Discussion (Misc queries) 1 January 11th 10 04:55 AM
Looping macro RK Excel Worksheet Functions 2 December 12th 06 11:29 PM
Looping macro furanku Excel Programming 1 September 25th 05 07:25 AM
Need help with my looping macro Pete Excel Programming 1 March 17th 05 11:09 PM


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