Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell inspection


Hi,

Im trying to drop into some VBA code but only if a specific cell i
selected. I am placing the call on the sheet change event. I a
assuming this is the correct way to do it.

The pseudocode would be as follows:

If cell x is selected then
event
endif
How is this done in VBA for EXCEL?

I am experienced in VBA for ACCESS but ECXEL is going to be a stee
learning curve!

Thanks everyone!

:confused

--
underhil
-----------------------------------------------------------------------
underhill's Profile: http://www.excelforum.com/member.php...nfo&userid=478
View this thread: http://www.excelforum.com/showthread.php?threadid=27408

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default cell inspection

Right-click the sheet tab and select View Code

Drop this code in:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B4")) Is Nothing And Target.Cells.Count
= 1 Then
MsgBox "event code"
End If
End Sub


The code ensures the cell count of the selection is just 1 cell
(Target.Cells.Count = 1)
It ensures the selection is at address B4


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"underhill" wrote in message
...

Hi,

Im trying to drop into some VBA code but only if a specific cell is
selected. I am placing the call on the sheet change event. I am
assuming this is the correct way to do it.

The pseudocode would be as follows:

If cell x is selected then
event
endif
How is this done in VBA for EXCEL?

I am experienced in VBA for ACCESS but ECXEL is going to be a steep
learning curve!

Thanks everyone!




--
underhill
------------------------------------------------------------------------
underhill's Profile:
http://www.excelforum.com/member.php...fo&userid=4786
View this thread: http://www.excelforum.com/showthread...hreadid=274084



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inspection report templates Michael Doose Excel Worksheet Functions 3 January 8th 07 03:40 PM
How do I build a Home Inspection form in Excel? Mike L. New Users to Excel 1 February 17th 06 10:59 PM
Re-occuring Inspection Dates Belarny Mic Excel Worksheet Functions 2 August 3rd 05 11:10 PM
Final House Walkthrough inspection in Excel would be nice Jondin Setting up and Configuration of Excel 0 February 18th 05 04:13 PM


All times are GMT +1. The time now is 08:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"