K
kiwis
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?
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?