LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Return contents of cell at Index position in Source Range of Drop

I have a macro that assigns the Cell link value for the Drop Down (from Form
Tools, not ActiveX). It merely sets the Drop Down's LinkedCell to the cell
that is under the TopLeft corner of the Drop Down control.

This causes the Index (Integer) of the selected item to be placed in the
LinkedCell. I must find the contents of the cell that is referenced by this
number as an offset into the Input Range of cells that are specified for this
Drop Down control. I must copy that string from the source range to another
cell, but I don't know the VBA code to accomplish this. The part of this
code that assigns the LinkedCell works, but the line after that (the Set
SourceRange) fails with:
Run-time error '438':
Object doesn't support this property or method

Dim SourceData As Range
Dim Val as String
For Each bx In ActiveSheet.DropDowns
bx.LinkedCell = bx.TopLeftCell.Address(external:=True)
' 2 lines of psuedo-code below. What's the real syntax?
Set SourceData = Range(bx.RowSource)
Val = SourceData.Offset(bx.LinkedCell)
Next

Question 1) What is the real VBA code needed to return the contents of the
cell referenced by the Index value that is now stored in the LinkedCell?

Question 2) Where does one find the documentation for the methods and
properties of these controls from the Form Tools menu. I see all sorts of
help that deal with creating drop downs, but little about VBA reference to
their methods and properties.

--
I am the math. You know what to do.
 
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
Formula to return cell position AJPendragon Excel Worksheet Functions 1 February 6th 06 09:34 PM
How to I return the position of a selected cell in a range? [email protected] Excel Programming 4 November 16th 05 02:32 PM
Excel formula to find position of the contents of a cell within a column. [email protected] Excel Discussion (Misc queries) 3 September 26th 05 03:52 PM
find the first blank cell in a range and return me it's position steve alcock Links and Linking in Excel 2 May 13th 05 09:03 AM
Copy named range contents to activecell position Neal Excel Programming 2 October 28th 04 02:20 PM


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

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"