Simple Macro, Slow Calculation. Help speed up please

jlieu

New Member
Joined
Jun 9, 2015
Messages
11
I have a very simple command button that adds 1 to a cell like a tally.

Code:
Dim whiteBloodCell As Integer
whiteBloodCell = Range("E10").Value + 1
Range("E10").Select
ActiveCell.FormulaR1C1 = whiteBloodCell

The problem I have is that lets say I see 2 white blood cells. I want to double click the command button, but it only lets me click the command button at about one click per second. I was wondering if anyone knew a way so that there is no lag in computation. Running a dual core i5 with 8 gb of ram if that helps. Thank you everyone in advance!
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,767
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
Is that all of the code under the command button ??
You don't need to keep using Select to work with a cell !
Code:
Range("E10").Value=Range("E10").value +1
 

jlieu

New Member
Joined
Jun 9, 2015
Messages
11
Yep, that's everything. I'm pretty stumped why excel would limit me to such few clicks per second.
 

jlieu

New Member
Joined
Jun 9, 2015
Messages
11

ADVERTISEMENT

Oh, that looks way better than mine. Much more compact. I tried switching it out for my code. It still takes a minimum of 1 second before I can click again.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,266
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

Mine advances as fast as I can click the mouse
 

jlieu

New Member
Joined
Jun 9, 2015
Messages
11
I feel like it does help not selecting the cell. Still a little wonky with double clicks, but doing 3+ helps a lot. That's good enough for me, thank you very much!!
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,767
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
If that is all the code for that action, I'm wondering if you have some recalculation events going on ??
As My aswer is this stated, this should work as fast as you can click the mouse !!
So, is there a whole heap of other cells affected by this mouse click ??
If so, maybe you need to do a Manual calculation until all code is completed !
 

Watch MrExcel Video

Forum statistics

Threads
1,123,531
Messages
5,602,209
Members
414,513
Latest member
junbuggle

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
Top