Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 109
Default Syntax error

I have previously been kindly provided with code to automatically add combo
boxes to a workbook (see below).

However I now wish to amend the code so that the range for the combo boxes
input are on a different tab. I can not get the right Syntax for this to
work correctly. I wonder if some one could amend correctly please, thank-you.

The troublesome line is:

= .Parent.Range(Back-Up Data!"I7:I24").Address(external:=True)


Kindest of regards,

Neil


Option Explicit
Sub COMBOboxes()

Dim myCell As Range
Dim myRng As Range
Dim myDD As DropDown
Dim wks As Worksheet

Set wks = ActiveSheet

With wks
.DropDowns.Delete 'nice for testing!
Set myRng = .Range("D10:D66")
For Each myCell In myRng.Cells
With myCell
Set myDD = .Parent.DropDowns.Add _
(Top:=.Top, _
Left:=.Left, _
Width:=.Width, _
Height:=.Height)

myDD.ListFillRange _
= .Parent.Range(Back-Up
Data!"I7:I24").Address(external:=True)
myDD.LinkedCell = .Offset(0, 1).Address(external:=True)
myDD.LinkedCell = .Offset(0, 1).Address(external:=True)
myDD.ListIndex = 1 '<-- added
End With
Next myCell
End With
End Sub
 
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
syntax error - help Jim May Excel Discussion (Misc queries) 2 August 23rd 07 09:08 PM
Lookup : Syntax Error Steve_n_KC Excel Worksheet Functions 0 June 14th 07 07:59 PM
what is a syntax error in microsoft acess Syntax Error Charts and Charting in Excel 0 July 28th 05 05:56 AM
Formula syntax error - chinese and gibberish Joshua Fandango Excel Discussion (Misc queries) 3 March 29th 05 01:27 PM
Vlookup Syntax Error YV New Users to Excel 9 December 23rd 04 05:28 PM


All times are GMT +1. The time now is 11:35 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"