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


Hi guys,

I have a spreadsheet, with a grid on it.

What i woudl like to do, is every time a user of the file clicks ona
particular cell in the grid it runs a piece of code (mainly an input
box).

Is there anyway to do this so it is automatic, whcih out having to
press a button?

Cheers

Fernando


--
Fernandoalberte
------------------------------------------------------------------------
Fernandoalberte's Profile: http://www.excelforum.com/member.php...o&userid=24493
View this thread: http://www.excelforum.com/showthread...hreadid=383130

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Links a cell to code


Hi Fernando,

Yes there is. By using the Worksheet_SelectionChange Event. Some
example code is shown below:


Code:
--------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Address
Case Insulation_Type_Address
Call Set_Insulation_Drop_Down(Target)
Case Thickness_Address
Call Set_Thickness_Drop_Down(Target)
Case Outlet_Type_Address
Call Set_Outlet_Type_Drop_Down(Target)
Case Outlet_Size_Address
Call Set_Outlet_Size_Validation(Target)
End Select
Call Check_Data_Entry(Target)
End Sub
--------------------


The code above calls a different subroutine if the target address is
the same as one of the ones specified in the case statement and then
runs the CHECK_DATA_ENTRY subroutine for all cells.

Regards

Rich


--
Rich_z
------------------------------------------------------------------------
Rich_z's Profile: http://www.excelforum.com/member.php...o&userid=24737
View this thread: http://www.excelforum.com/showthread...hreadid=383130

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Links a cell to code


This is great just what i need, but i am not sure i follow the code.

Which bits would i need to change if i wanted the code to run different
sub routines if i select cell "a1" vs if i select cell "b1"?

Sorry to be a pain.

Fernando


--
Fernandoalberte
------------------------------------------------------------------------
Fernandoalberte's Profile: http://www.excelforum.com/member.php...o&userid=24493
View this thread: http://www.excelforum.com/showthread...hreadid=383130

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
Creating XL links in VBA code Joel Excel Programming 0 May 24th 05 06:49 PM
Any way to update links tru VBA code? nrage21[_47_] Excel Programming 1 March 5th 04 05:32 PM
Does workbook contain code and links Paul Christie Excel Programming 2 August 1st 03 06:25 AM
VBA Code for Links to Excel workbooks Sandy[_3_] Excel Programming 2 July 23rd 03 03:14 AM
Code for existing links Sandy[_3_] Excel Programming 3 July 15th 03 07:42 PM


All times are GMT +1. The time now is 01:09 PM.

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

About Us

"It's about Microsoft Excel"