Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Excel: Calculate a specific range

Posted on 2015-02-24
Medium Priority
60 Views
Experts,

I am using a VLOOKUP in a set of merged cells (C22:K23) to create a brief description. The description changes each time one of 12 cells (E8:E19) are selected. The description goes away when a cell outside of these 12 cells is selected.  I am currently doing this with the Calculate function in the SelectionChange Event. However, now a user can't do anything else on the sheet because of Calculation running every time a new cell is selected.

How can I only Calculate the cell containing the VLOOKUP function?

Thanks, Dale
0
Question by:Dale Logan
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
1 Comment

LVL 22

Accepted Solution

rspahitz earned 2000 total points
ID: 40629829
You'll notice that the SelectionChange event has a parameter with it, ByVal Target As Range.  this allows you to find out which cell was selected.  Based on that you can tell it to calculate only if the cell is within the desired range, like this:

``````Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If (Target.Row >= 8 Or Target.Row <= 19) And Target.Column = 5 Then ' E8-E19
End If
End Sub
``````
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
###### Suggested Courses
Course of the Month8 days, 4 hours left to enroll