Web vb worksheets (sheet1).activate activesheet.pagesetup.orientation = xllandscape activesheet.printout this example uses the beforedoubleclick event to open a specified set of files in notepad. To make a single sheet the active sheet, use the activate method. This code line selects a worksheet based on its sheet tab name More activate / select sheet examples. To select the current worksheet, use the activesheet object: To use this example, your. Select worksheet with vba code name sheet1.select. Web the code i am using only selects the first row in the worksheet and not the entire worksheet. Web to select a sheet or multiple sheets, use the select method. If you want to select a worksheet instead of activating it you can use.select in the above codes instead of activate command.
Web it either needs to be wb1.sheets (sheet1). I keep on getting a run time error code 9. Select worksheet by tab name. Sub importfile () application.screenupdating = false dim parentworkbook as excel.workbook dim otherworkbook as excel.workbook dim workbookname as variant set parentworkbook = activeworkbook workbookname =. And you can use something like this to get a variable sheet name from an inputbox. You can use activate method of worksheet object to make a single cell as active cell. Thisworkbook.sheets (n&a).range (b4:f16).select however this works: I'm trying to activate a worksheet based on a variable. More activate / select sheet examples. Web if multiple worksheets are selected, then the worksheet with top most priority is considered as active sheet. Web select worksheet by variable.