Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #15  
Old 06-05-2015, 10:29 PM
excelledsoftware excelledsoftware is offline Carbon Footprint Calculator problem Windows 8 Carbon Footprint Calculator problem Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

NoSparks, thanks so much for your contribution. I actually have never used intersect before and it really looks like the best way to write this out. I have taken your contribution and updated the worksheet module to something that works really well.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  Dim Preview As Range, DataRange As Range
  
  'Set references
  Set Preview = Range("M1")
  Set DataRange = Range("E16:I18")

  'Ensure you are in the right area
  Application.EnableEvents = False
  If Intersect(Target, DataRange) Is Nothing Or Target.Cells.Count > 1 Then
    Application.EnableEvents = True
    Exit Sub
  Else
    Preview = Target.Value
  End If
 Application.EnableEvents = True
End Sub
Emma go ahead and replace the existing code with this one and then you can set the range and preview to whatever you want.

Thanks to both Charles and NoSparks for their help.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Carbon Footprint Calculator problem Result Calculator Raza Excel Programming 7 01-26-2015 11:35 PM
Excel Calculator Mandusin Excel 6 12-25-2010 07:34 AM
Age Calculator in MS Outlook 2002 SP3 turns Outlook 0 06-15-2010 12:26 AM
**FIND OUT WHO WAS BCC(BLIND CARBON COPIED) ON YOUR EMAILS?? sharpescalade Outlook 1 11-30-2006 08:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft