VBA slowing a sheet?

stevod

Board Regular
Joined
Aug 21, 2013
Messages
67
Hi,

I've made a sheet, macro enabled and have a few macros that run some code. Its a blank sheet, data gets pasted in press a button and the code runs (i'm just being very simple here). There's not a lot of data, columns C:AZ and random in length, the sheets it comes from are like 20kb.

The issue i'm having is when i paste the data in and run the code, this works fine. It deletes columns, cuts and moves them. Finds changes in a specific column and inserts borders for each change and a few more things. Nothing too taxing.

I have a reset code and this is where it slows down, it literally selects the columns
Columns("C:AZ").Select
Selection.Delete Shift:=xlToLeft
Range("C1").Select

Then when i paste different data it takes a good 10 to 15 seconds, then to run the macro it will have a grey screen and takes 3 or 4 times as long to do it.
my only fix is to close it, reopen and it works fine... once

Anyone encountered this before? And is there a simple solution?

Thanks for looking, Steve
 
Firstly, have you implemented the changes that have recommended to you
secondly, if you press CTRL + End on the sheet in question, which cell does it highlight.
I'm guessing you are processing much more of the sheet than is necessary
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
If U remedy your code as Micheal M has suggested and continue to insist on using copy and paste, then U will need to clear the clipboard or it will crash after repetitive use. U are not clearing the clipboard with your current code. Here's a link to some code to remedy your clipboard woes. Better yet, load your data in an array and manipulate the array to produce your output without using any copy/paste. HTH. Dave
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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