Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Aug 11, 2010
Messages
11
Location
US
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)


 
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

Back
Top