Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perfroming calculations on highlighted cells in Excel

Status
Not open for further replies.

xqv

Mechanical
Aug 11, 2010
11
End goal is this:
I have a large table of numbers, when I highlight a portion of the numbers and click a button a macro will use the highlighted numbers in various calculations. I am looking to do this regardless of what portion of the data I select. This would be like the average, count, sum, etc, data displayed in the status bar at the bottom of the screen, just different calculations.

The calculations and the message box that would appear with the results I think I can figure out, but I am not sure how to call in the highlighted range of numbers. Does anyone know how to do this?

my best guest is:

dim Highlighted as Range
dim answer as double

set highlighted as selection

answer = count(highlighted)


 
Replies continue below

Recommended for you

As mentioned the last time you asked a question in this forum... this type of question is better asked on Tek-Tips.

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Or at eng-tips, Excel forum:
forum770
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor