Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a Validation List Through Macro

Hi,

I have two excel sheets
1) Excel1.xls which contains the code below. This excel sheet is use
to open Excel2.xls within which the validation list needs to b
created. But i seem to be having a problem here

I am trying to create a validation list through a macro. The code i a
using
is as follows:

'Open the excel sheet where the valdiation list is to be added
Set objExcel = CreateObject("Excel.Application")
ExcelToBeOpened = Application.GetOpenFilename(filefilter:="Excel Files

*.xls")
objExcel.Workbooks.Open Filename:=ExcelToBeOpened
objExcel.Visible = True

'The validation list is to be created in another excel sheet that i
open
Wit
objExcel.Workbooks(1).Worksheets("Sheet1").Range(" N3:N1000").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop,
Operator:=xlBetween, Formula1:="Yes,No"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With

But this doesnt seem to work. Any ideas why and what change should b
done?

Thanks
--
Senior Consultant
Kanbay Software (I) Pvt. Ltd.
http://www.kanbay.com

Attachment filename: desktop.zip
Download attachment: http://www.excelforum.com/attachment.php?postid=64557
--
Message posted from http://www.ExcelForum.com

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
Data Validation List Macro Lisa C. Excel Discussion (Misc queries) 18 April 6th 09 12:53 PM
Creating a Data Validation List based on a Value in another cell LondonLion Excel Worksheet Functions 2 June 8th 07 12:23 AM
Creating a list (data validation) fromt wo different source ranges tony Excel Discussion (Misc queries) 1 August 1st 06 03:40 AM
Creating a Validation List Through Macro Pavan Kishore K. S.[_2_] Excel Programming 0 August 11th 04 05:07 AM
Macro on a data validation list Kevin Excel Programming 1 November 14th 03 07:14 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"