Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Is it possible to open the VBA form with a link in a sheet and to pass variable from a cell to the VBA form?

I am new in excel VBA programming and now facing a problem is that:

I have a worksheet containing the company details and each company
contain a unique ID. I have create a VBA form to list the detail of a
specified company using their company ID (I am now hardcode the ID in
the form at this moment). I want to allow users to open the VBA form
to see the company detail by clicking the company ID in the worksheet.
But I do not know how the form link with the company ID in the
worksheet.

Is it possible to call the VBA form with a link? In addition, is it
possible to pass the ID from the worksheet to the form? Or any other
solutions.

Thanks for helping.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Is it possible to open the VBA form with a link in a sheet and to pass variable from a cell to the VBA form?

You would use the RefEdit control, and when the user clicks in this
control,. they can access the worksheet, so to select a cell. You then just
pickup that value, and get any details associated with it.

RefEdit doesn't automatically appear on the toolbox, but you can get it by
right-clicking on the toolbox, and clicking Additional Controls. Then scroll
down that list to the 'RefEdit Ctrl', and check that item. It will then
appear on your toolbox.

But I have to ask, why bother. If the data is in a worksheet, you can use
DataForms on that worksheet, and Excel does it for you.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Daniel" wrote in message
om...
I am new in excel VBA programming and now facing a problem is that:

I have a worksheet containing the company details and each company
contain a unique ID. I have create a VBA form to list the detail of a
specified company using their company ID (I am now hardcode the ID in
the form at this moment). I want to allow users to open the VBA form
to see the company detail by clicking the company ID in the worksheet.
But I do not know how the form link with the company ID in the
worksheet.

Is it possible to call the VBA form with a link? In addition, is it
possible to pass the ID from the worksheet to the form? Or any other
solutions.

Thanks for helping.



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
pass to textbox on a form and to excel worksheet cvw New Users to Excel 0 March 16th 10 07:35 PM
Using a template form, advance a form number everytime you open ShoDan Excel Discussion (Misc queries) 1 January 31st 08 01:34 PM
Open a Spread Sheet In a Mdi form In Vb.net WStoreyII[_2_] Excel Programming 0 August 17th 04 11:14 PM
Pass parameter to a form and then open it? Darren Hill[_2_] Excel Programming 3 February 7th 04 06:21 PM
link a cell into a vba form newman Excel Programming 3 October 27th 03 04:42 AM


All times are GMT +1. The time now is 06:32 AM.

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"