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: 24
Default get validation on a cell clicking a button

Hi

I did not get any errors when i run the macro to get the product list.

when i try calling the macro by clicking on the button, i get this
error msg
run-time error 1004
Application-defiend or object-defined error

product list on sheet 2, validation cell on sheet 3, button on sheet
1,ws is sheet 2

Code for the button
Private Sub CommandButton1_Click()
'get stock code to cell C3 on result page
Call findpdtlist
End Sub

part of the code to get product list, result is sheet 3

Set rng = ws.Range("A2:A" & lastr)
rng.Name = "pdtlist"

'get the pdt list on result page
With Worksheets("Result").Range("C3").Validation
.Add Type:=xlValidateList, Formula1:="=pdtlist" <-----------
this line is flag out by the debugger
End With

there is no error when i just run the macro directly.

Why is the error appearing & how to solve it?

 
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
Clicking submit button on web page RudyShoe Excel Programming 4 January 30th 07 02:52 AM
clicking on a button copies the choice *(VBA) Thrava Excel Discussion (Misc queries) 1 October 2nd 06 10:42 PM
Get info on toolbar button by clicking on it Spamarrant Excel Programming 0 August 25th 06 01:33 PM
Choosing different cell values by user clicking a button alymcmorland[_14_] Excel Programming 5 November 4th 05 03:41 PM
Excel VBA: Pass value when clicking button Milli[_5_] Excel Programming 3 June 10th 04 11:44 PM


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