macro help

Joneye

Well-known Member
Joined
May 28, 2010
Messages
785
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
I run this macro to view an area of a screen, my one problem is it returns it to an odd place in the screen.








Sub sale_out_view()
'
' sale_out_view Macro
' Macro recorded 24/03/2011 by Jon.Iremonger
'

'
Selection.AutoFilter Field:=19, Criteria1:=">01/01/2011", Operator:=xlAnd
Columns("F:O").Select
Range("O1").Activate
Selection.EntireColumn.Hidden = True
Range("V1").Select
ActiveCell.FormulaR1C1 = ""
Range("V1").Select
End Sub
Sub return_view()
'
' return_view Macro
' Macro recorded 24/03/2011 by Jon.Iremonger
'

'
Selection.AutoFilter Field:=19
Columns("E:P").Select
Range("P1").Activate
Selection.EntireColumn.Hidden = False
Range("X1").Select
End Sub
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Try:
Rich (BB code):
Sub return_view()
'
' return_view Macro
' Macro recorded 24/03/2011 by Jon.Iremonger
'

'
Selection.AutoFilter Field:=19
Columns("E:P").Select
Range("P1").Activate
Selection.EntireColumn.Hidden = False
Range("A1").Select
End Sub
Change A1 to whatever cell you want the macro to finish on<!-- / message --><!-- sig -->
 
Upvote 0
Code:
Sub sale_out_view()
    Cells.AutoFilter Field:=19, Criteria1:=">01/01/2011"
    Columns("F:O").Hidden = True
    Range("V1").FormulaR1C1 = ""
End Sub

Sub return_view()
    Cells.AutoFilter Field:=19
    Columns("F:O").Hidden = False
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,628
Members
452,933
Latest member
patv

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