Code help need

Bobmn4

New Member
Joined
Dec 3, 2020
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I am trying to get my copied Data to paste in the very next box but the DEBUG stops on the following any advise to get it to drop down to the next blank box I cant set a specific box because the information being copy and pasted varies. this code literally worked for weeks and just stopped today

Range("A2:J1003").Select
Selection.Copy
Sheets("EOC").Select
Range("A1").Select

Selection.End(xlDown).Offset(1, 0).Select

ActiveSheet.Paste
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi & welcome to MrExcel.
Try replacing all that code with
VBA Code:
Range("A2:J1003").Copy Sheets("EOC").Range("A" & Rows.Count).End(xlUp).Offset(1)
 
Upvote 0
Hi & welcome to MrExcel.
Try replacing all that code with
VBA Code:
Range("A2:J1003").Copy Sheets("EOC").Range("A" & Rows.Count).End(xlUp).Offset(1)
It failed at ActiveSheet.Paste

Range("A2:J1003").Copy Sheets("EOC").Range("A" & Rows.Count).End(xlUp).Offset(1)
ActiveSheet.Paste
 
Upvote 0
It replaces all the code you posted.
 
Upvote 0
I Nulled my previous codes and not it stopped at the next code

'Range("A2:J1003").Select
'Selection.Copy

'Adding Greens below reds
'Sheets("EOC").Select
'Range("A1").Select
'Range("A" & Rows.Count).End(xlUp).Offset (1)
'Selection.End(xlDown).Offset(1, 0).Select

Range("A2:J1003").Copy Sheets("EOC").Range("A" & Rows.Count).End(xlUp).Offset(1)
ActiveSheet.Paste

So after your code it goes as follows

Range("A2:J1003").Copy Sheets("EOC").Range("A" & Rows.Count).End(xlUp).Offset(1)
ActiveSheet.Paste

Application.CutCopyMode = False
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 5287936
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.End(xlUp).Select
 
Upvote 0
Get rid of the ActiveSheet.Pasteline
 
Upvote 0
Should have.
On the EOC sheet do Ctrl End & then look at col A for that row & above
 
Upvote 0

Forum statistics

Threads
1,215,372
Messages
6,124,531
Members
449,169
Latest member
mm424

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