Unsure of Loop

Davebro

Board Regular
Joined
Feb 22, 2018
Messages
113
Office Version
  1. 2016
Platform
  1. Windows
I am looking to find a loop through my macro.

Sub Macro1()
'


'
ActiveCell.Select
Selection.Copy
ActiveCell.Offset(8, -1).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
ActiveCell.Select
Selection.End(xlDown).Select
ActiveCell.Offset(4, 1).Range("A1").Select

End Sub
 
Using ActiveCell and Select within Loops is not a good idea. Not only is it very slow and can bog your code down, as you can see, you may encounter errors, as you have no way of knowing when/where to stop.

I have been trying to help you out, but you seem to be hesitant to give me all the information that I am asking for. Without it, I am afraid I cannot help you any further.
And it looks like you just kind of ignored everything I told you and went back to what you were doing originally anyway.
So if you aren't going to bother trying to take any of my advice, I will just move along. I have already spent enough time on this, and you do not seem to want to use of it.
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Using ActiveCell and Select within Loops is not a good idea. Not only is it very slow and can bog your code down, as you can see, you may encounter errors, as you have no way of knowing when/where to stop.

I have been trying to help you out, but you seem to be hesitant to give me all the information that I am asking for. Without it, I am afraid I cannot help you any further.
And it looks like you just kind of ignored everything I told you and went back to what you were doing originally anyway.
So if you aren't going to bother trying to take any of my advice, I will just move along. I have already spent enough time on this, and you do not seem to want to use of it.

Hello again, we seemed to be getting bogged down with what was in B4, as the macro works with whatever is in that cell. I just need the macro to go through the rows and change the needed cells. I can live with the error message as the macro completes before it delivers it. Ido appreciate your help, it was your input that made me look at it again. I will keep trying to resolve the "Item" in your suggested code. But like you say you have spent enough time on this. Thank you again.
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,264
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top