ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to Use QuestionToMessageBox with Input for Cell (https://www.excelbanter.com/excel-programming/454294-how-use-questiontomessagebox-input-cell.html)

David Godinger[_2_]

How to Use QuestionToMessageBox with Input for Cell
 
How can I put in a variable that comes from a named cell in the spreadsheet.

Here's my line, and I'd like

QuestionToMessageBox = ("Are you CERTAIN you've copied the contents of this sheet into a new one?" _

& namedCellFromSheet & " some more text?")

Claus Busch

How to Use QuestionToMessageBox with Input for Cell
 
Hi David,

Am Thu, 9 May 2019 23:45:35 -0700 (PDT) schrieb David Godinger:

How can I put in a variable that comes from a named cell in the spreadsheet.

Here's my line, and I'd like

QuestionToMessageBox = ("Are you CERTAIN you've copied the contents of this sheet into a new one?" _

& namedCellFromSheet & " some more text?")


try:

QuestionToMessagebox = MsgBox("Are you CERTAIN you've copied the contents of this sheet into a new one? " _
& Range("Sheet1!NamedCell.Name") & " some more text?", vbYesNo, "Question")


Regards
Claus B.
--
Windows10
Office 2016

David Godinger[_2_]

How to Use QuestionToMessageBox with Input for Cell
 
Thanks, Claus, it worked perfectly!

The little piece of my VBA ended up looking like: & Range("Chart!nameInsert") &


All times are GMT +1. The time now is 12:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com