Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help anyone
Sub TesterAA()
Dim StrMGR_SHORT_NAME As String Dim StrMGR_LONG_NAME As String Dim strTitle As String, strDefault As String Dim strMessage As String strMessage = "ENTER LONG DISPLAY NAME OF WRAP MANAGER" strTitle = "" strDefault = "" StrMGR_LONG_NAME = InputBox(strMessage, strTitle, strDefault) Sheets("INPUTS").Range("C11").Value = StrMGR_LONG_NAME ' cell C11 populates strMessage = "ENTER SHORT NAME OF WRAP MANAGER" strTitle = "" strDefault = "" StrMGR_SHORT_NAME = InputBox(strMessage, strTitle, strDefault) MsgBox StrMGR_SHORT_NAME Sheets("INPUTS").Range("C29").Value = StrMGR_SHORT_NAME ' cell C29 does not End Sub Which is your code, worked fine for me. Are you sure you don't overwrite the value in C29 with later lines of code. -- Regards, Tom Ogilvy "Grace" wrote in message ... I was having trouble with public declarations et al amongst modules, and decided the only variable which was problematic in a filename I was trying to concatenate was the one where I tried to call the variable instead of a worksheet cell populated with that variable's value. So, I decided, even though the spreadsheet didn't "need" it, to just do the same thing, i.e., stick the result in a worksheet cell, and then use the cell's value in creating the filename. But I am having trouble with this, too. This is part of a macro: strMessage = "ENTER LONG DISPLAY NAME OF WRAP MANAGER" StrTitle = "" StrDefault = "" StrMGR_LONG_NAME = InputBox(strMessage, StrTitle, StrDefault) Sheets("INPUTS").Range("C11").Value = StrMGR_LONG_NAME ' cell C11 populates strMessage = "ENTER SHORT NAME OF WRAP MANAGER" StrTitle = "" StrDefault = "" StrMGR_SHORT_NAME = InputBox(strMessage, StrTitle, StrDefault) MsgBox StrMGR_SHORT_NAME ' the macro confirms that this is producing the string entered in the InputBox query Sheets("INPUTS").Range("C29").Value = StrMGR_SHORT_NAME ' cell C29 does not populate, why? In the first case, it clearly puts the result of what I entered in cell C11. In the 2nd case, it is NOT putting the result I entered in cell C29. As you can see from my message box statement, I check to make sure that the strMGR_SHORT_NAME is getting the right result and indeed it is. Cell C29 is not protected so that is not the problem. What can explain why the C11 value is populating on the spreadsheet, but the C29 value is not? Thanks, Grace |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help anyone
That is exactly what I somehow did. I am Ok now.
Thanks, Grace "Tom Ogilvy" wrote in message ... Sub TesterAA() Dim StrMGR_SHORT_NAME As String Dim StrMGR_LONG_NAME As String Dim strTitle As String, strDefault As String Dim strMessage As String strMessage = "ENTER LONG DISPLAY NAME OF WRAP MANAGER" strTitle = "" strDefault = "" StrMGR_LONG_NAME = InputBox(strMessage, strTitle, strDefault) Sheets("INPUTS").Range("C11").Value = StrMGR_LONG_NAME ' cell C11 populates strMessage = "ENTER SHORT NAME OF WRAP MANAGER" strTitle = "" strDefault = "" StrMGR_SHORT_NAME = InputBox(strMessage, strTitle, strDefault) MsgBox StrMGR_SHORT_NAME Sheets("INPUTS").Range("C29").Value = StrMGR_SHORT_NAME ' cell C29 does not End Sub Which is your code, worked fine for me. Are you sure you don't overwrite the value in C29 with later lines of code. -- Regards, Tom Ogilvy "Grace" wrote in message ... I was having trouble with public declarations et al amongst modules, and decided the only variable which was problematic in a filename I was trying to concatenate was the one where I tried to call the variable instead of a worksheet cell populated with that variable's value. So, I decided, even though the spreadsheet didn't "need" it, to just do the same thing, i.e., stick the result in a worksheet cell, and then use the cell's value in creating the filename. But I am having trouble with this, too. This is part of a macro: strMessage = "ENTER LONG DISPLAY NAME OF WRAP MANAGER" StrTitle = "" StrDefault = "" StrMGR_LONG_NAME = InputBox(strMessage, StrTitle, StrDefault) Sheets("INPUTS").Range("C11").Value = StrMGR_LONG_NAME ' cell C11 populates strMessage = "ENTER SHORT NAME OF WRAP MANAGER" StrTitle = "" StrDefault = "" StrMGR_SHORT_NAME = InputBox(strMessage, StrTitle, StrDefault) MsgBox StrMGR_SHORT_NAME ' the macro confirms that this is producing the string entered in the InputBox query Sheets("INPUTS").Range("C29").Value = StrMGR_SHORT_NAME ' cell C29 does not populate, why? In the first case, it clearly puts the result of what I entered in cell C11. In the 2nd case, it is NOT putting the result I entered in cell C29. As you can see from my message box statement, I check to make sure that the strMGR_SHORT_NAME is getting the right result and indeed it is. Cell C29 is not protected so that is not the problem. What can explain why the C11 value is populating on the spreadsheet, but the C29 value is not? Thanks, Grace |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|