VBA code to copy black of data below its self not working the same suddenly.

CreativeUsername

Board Regular
Joined
Mar 11, 2017
Messages
52
Hi,

I have a section of code that grabs a block of data and copies itself below 2x times. The data should overwrite the blanks at the end of the grabbed section each time.
What happens now is it goes to the end including the blanks that were just selected. I want to drop the data right below its self so that I have a triplication of it.

Code:
 Application.CutCopyMode = False '<----------- Clears clip board
Range(Range("E2"), Range("E2").End(xlDown)).Copy '<------------------ copies Accont numbers to new locaction 2x
For IDX = 1 To 2
    Cells(Range("E2").End(xlDown).Row + 1, "E").Select
    ActiveSheet.Paste
Next
Application.CutCopyMode = False [code]

I need it to stop at the blanks and drops the block on the first blank found.  Hopefully I don't need to do surgery because this or something very close to it was working.

Thanks guys
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
This is what your code does. Is it not what you wanted?

[TABLE="width: 189"]
<tbody>[TR]
[TD]33[/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD]66[/TD]
[TD]66[/TD]
[/TR]
[TR]
[TD]99[/TD]
[TD]99[/TD]
[/TR]
[TR]
[TD]bb[/TD]
[TD]bb[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]66[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]99[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]bb[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]66[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]99[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]bb[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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