spreadsheet zeros out and won't run after initial query

johnandbeth

Board Regular
Joined
Apr 8, 2002
Messages
168
I had some great help from some of the experts here on this topic: http://www.mrexcel.com/board2/viewtopic.php?t=233293&highlight=

When you open this worksheet, now I can type in the 2 variables and it will give me the correct information. But if I want to, after running that query, run another query and put in the two variables, the "answer" section clears itself out and doesn't run the search.

How would I add some vba into my spreadsheet that will let me run the search/variables again without closing out and going back in?

Thanks,
Beth
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hello Beth,
I checked out the linked thread above and that recorded code cleaned up would look
something like this:
Code:
Sub Rectangle2_Click()
Range("D12:F13").Copy Range("AC3:AE4")
Range("AG2").Value = Range("AE2").Value
With Range("L7:M1942")
  .Value = Range("AG6:AH1941").Value
  .Sort Key1:=Range("L7"), Order1:=xlAscending, Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End With
Range("D7:F9, D12:F13").ClearContents
Range("I3").Select
End Sub
However I don't see what code you're using now to run your query and want to make
changes to.
Am I missing something or do you have other code that you're referring to?
 
Upvote 0
In addition to that code that runs when you click "Sort by Output" button on the worksheet, there are these macros in the workbook. I hope this is what you meant.

Thanks,
Beth


Sub TestSplashScreen()
UserForm4.Show
End Sub
Sub LevelScreen()
UserForm5.Show

End Sub


Private Sub KillTheForm()
Unload UserForm4
End Sub
Sub Macro1()
'
' Macro1 Macro
Rows("55:59").Select
Selection.EntireRow.Hidden = True
End Sub
Sub Macro2()
'
' Macro2 Macro
Rows("55:59").Select
Selection.EntireRow.Hidden = False
End Sub
 
Upvote 0
Anyone got ideas about this for me?

Does anyone have a suggestion for how I can make this work? I would want it to work in Excel 2000, 2002, and 2003 (and hopefully also work in the upcoming versions of Excel).

Thanks again,
Beth
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,582
Members
449,039
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top