Trying to modify someone else's code:
Set ReturnArray = Application.InputBox("Select an area consisting of 3-rows and " & n3 - (n3 = 1) & _
" columns" & Chr(13) & "to report results.",
I don't get the n3 - (n3=1) part. What is it doing?
Thanks!
Trying to modify someone else's code:
Set ReturnArray = Application.InputBox("Select an area consisting of 3-rows and " & n3 - (n3 = 1) & _
" columns" & Chr(13) & "to report results.",
I don't get the n3 - (n3=1) part. What is it doing?
Thanks!
This line of code could be asking the user to select an area consisting of 3 rows and n3-1 columns. n3 could be a variable that is defined elsewhere in the code and is likely the number of columns in the area that the user is selecting. The (n3=1) part might be a condition which, if true, will subtract 1 from the number of columns and display it as the second part of the prompt.
If you only ever do what you can , you'll only ever be what you are.
Not much to read up onI haven't found this putting an equation inside parentheses documented anywhere. Where can I read up on it?
Thanks!
Sub demo() Dim n3 As Long n3 = 1 MsgBox n3 ' 1 MsgBox n3 = 1 ' True MsgBox CLng(n3 = 1) ' -1 MsgBox CLng(True) ' -1 MsgBox n3 - (n3 = 1) ' 2 End Sub
---------------------------------------------------------------------------------------------------------------------
Paul
Remember: Tell us WHAT you want to do, not HOW you think you want to do it
1. Use [CODE] ....[/CODE ] Tags for readability
[CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
2. Upload an example
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
3. Mark the thread as [Solved] when you have an answer
Thread Tools (on the top right corner, above the first message)
4. Read the Forum FAQ, especially the part about cross-posting in other forums
http://www.vbaexpress.com/forum/faq...._new_faq_item3
So why not simply write
rather thanSet ReturnArray = Application.InputBox("Select an area consisting of 3-rows and " & 2 & _ " columns" & Chr(13) & "to report results."
Set ReturnArray = Application.InputBox("Select an area consisting of 3-rows and " & n3 - (n3 = 1) & _ " columns" & Chr(13) & "to report results.",
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
Presumably, the value of n3 is not hard coded by the programmer
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ