Sir Newbie
04-15-2006, 06:55 AM
Well hello there,
Firstly, let me give a big thanks to all the people out there that bother to reply to questions from people like me. Sure, there are some people who don't appreciate the time, patience and effort. But there are also some who do! So, as a person who has copied and pasted more code than they probably should have (although I have been known to try and read the help file from time to time)... Thank you.
Secondly, I have a problem. My doctor says the lump on the back of my neck... No, no, wait...
I would like to validate some data in a column using only VBA code.
I would also like to get next week's lottery numbers, but that's another story.
I need the data to be whole numbers between 0 and (let's say) 100. But when I use the following code, I get an error saying...
Run-time error '1004':
Application-defined or object-defined error
With Range("c6").Validation
.Add Type:=xlValidateWholeNumber, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="5", Formula2:="10"
.InputTitle = "Integers"
.ErrorTitle = "Integers"
.InputMessage = "Enter an integer from five to ten"
.ErrorMessage = "You must enter a number from five to ten"
End With
I've tried the example code that comes with Excel 2000. I've tried code from other programmers. I've tried using code that involves the "If" statement. I've tried... Need I go on?
Oh the pain!
Overall, here's my objective...
I need to create a spreadsheet ("Spreadsheet C") that contains only the products that the user has ordered (so that they can print it out).
To achieve this...
"Spreadsheet B" gets its data from "Spreadsheet A" when the user (she's a good looking chick I just happen to know) clicks on a button that's located in "Spreadsheet B". Then "Spreadsheet B" identifies any errors, asks the user to correct them and when they are correct, it creates another spreadsheet ("Spreadsheet C").
In other words...
Spreadsheet A >>> Spreadsheet B = Spreadsheet C.
But it ain't happening.
Can anyone work this problem out?
I know I can't :)
Thanks in advance!
PS: This may surprise you, but I'm not a professional programmer. So, an answer in plain English would be greatly appreciated! Thanks :)
Firstly, let me give a big thanks to all the people out there that bother to reply to questions from people like me. Sure, there are some people who don't appreciate the time, patience and effort. But there are also some who do! So, as a person who has copied and pasted more code than they probably should have (although I have been known to try and read the help file from time to time)... Thank you.
Secondly, I have a problem. My doctor says the lump on the back of my neck... No, no, wait...
I would like to validate some data in a column using only VBA code.
I would also like to get next week's lottery numbers, but that's another story.
I need the data to be whole numbers between 0 and (let's say) 100. But when I use the following code, I get an error saying...
Run-time error '1004':
Application-defined or object-defined error
With Range("c6").Validation
.Add Type:=xlValidateWholeNumber, _
AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:="5", Formula2:="10"
.InputTitle = "Integers"
.ErrorTitle = "Integers"
.InputMessage = "Enter an integer from five to ten"
.ErrorMessage = "You must enter a number from five to ten"
End With
I've tried the example code that comes with Excel 2000. I've tried code from other programmers. I've tried using code that involves the "If" statement. I've tried... Need I go on?
Oh the pain!
Overall, here's my objective...
I need to create a spreadsheet ("Spreadsheet C") that contains only the products that the user has ordered (so that they can print it out).
To achieve this...
"Spreadsheet B" gets its data from "Spreadsheet A" when the user (she's a good looking chick I just happen to know) clicks on a button that's located in "Spreadsheet B". Then "Spreadsheet B" identifies any errors, asks the user to correct them and when they are correct, it creates another spreadsheet ("Spreadsheet C").
In other words...
Spreadsheet A >>> Spreadsheet B = Spreadsheet C.
But it ain't happening.
Can anyone work this problem out?
I know I can't :)
Thanks in advance!
PS: This may surprise you, but I'm not a professional programmer. So, an answer in plain English would be greatly appreciated! Thanks :)