I am lookking to add a yes/no message to box to the following piece of code that I have. I tried a few things but could not get to work. I would like the user prompt to ask the following ? ---> "Would you like to copy the date to column Cforum.ozgrid.com/index.php?attachment/67422/?". Then if "Yes" is selected, run the following macro. If "No", end the subroutine.
$20 USD: Add yes/no message box to code
-
-
-
Re: $20 USD: Add yes/no message box to code
Conditions of posting in this forum... Pay 10% of your offer to [email protected] before posting.
Once you confirm that is done with the (ref number), I'll post a solution.
-
Re: $20 USD: Add yes/no message box to code
10% has been sent via paypal
-
Re: $20 USD: Add yes/no message box to code
OK, just to confirm, you simply want a message box asking the user to confirm they want to copy the data. User selects Yes/No and the code proceeds accordingly?
If so.
Code
Display MoreSub CopyData() '//Note change - Integers can Overflow if rows > 32767 _ '// and even Excel 2003 can manage that. Dim a As Long '// You can make the 'No' button the default by adding 'vbDefaultButton2' as below '// ...C?", vbYesNo + VbQuestion + vbDefaultButton2, "Ple... If MsgBox("Would you like to copy the data to column C?", vbYesNo + vbQuestion, "Please Confirm") = vbYes Then a = Sheets("Sheet1").Range("B" & Rows.Count).End(xlUp).Row '// You should consider using Sheet CodeNames rather '// than Tab names, The code falls over if the user '// changes the Tab name. '// See the 'CodeName' property for the sheets in the VBA editor. For example '//Sheet1.Range("B5:B" & cStr(s)).Copy '// CodeName and TabName are identical to start with so the 'Sheet1' refers to the CodeName Sheets("Sheet1").Range("B5:B" & CStr(a)).Copy Sheets("Sheet1").Range("C5").PasteSpecial xlPasteValues End If End Sub
-
Re: $20 USD: Add yes/no message box to code
Perfect! Thank you! just let me know your info and I will send payment
-
-
Re: $20 USD: Add yes/no message box to code
I don't, and won't, use PayPal - which is a bit of problem.
It's not exactly the most complicated code and didn't exactly take a chunk out of my day (night) so let's split it 3 ways: 10% to OzGrid ($2 - Paid), 50% to you for a beer ($10 should get a decent quality one) and the remaining $8.00 plus any change from the beer to a charity of your choice - no confirmation needed, it's between you and your conscience...
-
Re: $20 USD: Add yes/no message box to code
Thank you cytop! I'm sorry, I only ever used PayPal for payments on this site. Appreciate the beer money and I am going to a charity fundraiser this weekend and will donate the $8 plus much more there.
-
Re: $20 USD: Add yes/no message box to code
No need to apologise - enjoy the beer and have a good time at the fundraiser.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!