You can do … ActiveWindow.visibleRange Above statement returns an Object of Range Type. However, besides setting the size and position of both the windows of the current workbook, I also need to set the size and position of another workbook (lets say Book2.xlsx) with the same macro. Hi! Sub テスト() Dim window1 As Window Windows("VBAsample.xls").Activate Set window1 = ActiveWindow MsgBox "セルB2が左上の位置にくるように表示します" window1.ScrollRow = 2 window1.ScrollColumn = 2 End Sub 上記マクロを実行すると次のよう表示されます。 CodeModule.CodePane.Window.Top = nn. Range("J8").Select ActiveCell.FormulaR1C1 = "=TRIM(SUBSTITUTE(RC[-8],CHAR(160),CHAR(32)))" Range("J8").Select Selection.AutoFill Destination:=Range("J8:J65536"), Type:=xlFillDefault Range("J8:J65536").Select ActiveWindow.ScrollRow = 65387 ActiveWindow.ScrollRow = 65273 ActiveWindow.ScrollRow = 65159 ActiveWindow.ScrollRow = 65045 ActiveWindow.ScrollRow = 64930 ActiveWindow… From the above statement it is clear that VisibleRange is a method of ActiveWindow of an Excel. VBA Coding Made Easy You may need a workbook to always open to a specific view or location on a sheet, or possibly just change the view from a macro. Below macro when run, opens a new excel window of the same workbook (lets say Book1.xlsm) and is used to set the size and position of both the worksheet windows on the screen.. In Excel, macro code is a programming code which is written in VBA (Visual Basic for Applications) language. Freeze Panes in Excel VBA. [SOLVED] Freeze pane Prob & Activewindow. It is a very simple command in VBA which gives you the visible range on your screen. Similar to freeze panes in Excel spreadsheet, to freeze panes in Excel VBA, select a Cell first, then set ActiveWindow.FreezePanes Property to TRUE.
The code >should run fine as written, but again, the With statement is superfluous as >written. In the screenshot, I have highlighted the direction of freeze of a selected cell, it is the top row and left column of a selected Cell. When I use ActiveWindow.Close in an Excel macro, I don't want the user to receive the prompt "do you want to save changes? Freeze Panes in Excel VBA. ActiveWindowプロパティの怪 Excel2010でのエラー 職場のPCはOffice2010なんだが、妙なエラーが出た。 ThisWorkbookモジュールに仕込んだWorkbook_Openイベントマクロでの話。 データを集約するマクロを作っていて、データ集約が終わったら、マクロを仕込んだブックから、不要なシートを削除して新 … ... Just select a range and run this macro and it will highlight top 10 values with the green color. Sub TopTen() myVar = ActiveWindow.VisibleRange I thought running this code in my macro would result in myVar containing the top-left and bottom-right cells of sheet area being viewed. Is there any in VBA to control the size and positioning of application windows, or folder windows (or any other windows)?