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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,454
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?
 

johnandbeth

Board Regular
Joined
Apr 8, 2002
Messages
168
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
 

johnandbeth

Board Regular
Joined
Apr 8, 2002
Messages
168
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
 

Forum statistics

Threads
1,137,332
Messages
5,680,867
Members
419,937
Latest member
Talic

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
Top