Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following vbs code opens Excel and selects the ranges A1-A10 and C2-C8:
Set objExcel = CreateObject("Excel.Application") objExcel.Workbooks.Add objExcel.Visible = True objExcel.ActiveSheet.Range("A1:A10,C2:C8").Select But how can I do such a selection with variables? e.g. SelectionPart1_Column = 1 SelectionPart1_RowFrom = 1 SelectionPart1_RowTo = 10 SelectionPart2_Column = 3 SelectionPart2_RowFrom = 2 SelectionPart2_RowTo = 8 The following command selects only the first part (A1-A10): objExcel.ActiveSheet.Range(objExcel.Cells(Selectio nPart1_RowFrom, SelectionPart1_Column), objExcel.Cells(SelectionPart1_RowTo, SelectionPart1_Column)).Select But how can I add to the already selected part 1 also part 2 (C2-C8)? Any help is very appreciated Stefan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select multiple ranges in formula | Excel Discussion (Misc queries) | |||
in charting, how do i select data ranges from multiple sheets, sa. | Charts and Charting in Excel | |||
select multiple cell ranges in "sumif" formula? | Excel Worksheet Functions | |||
Select instersection of two ranges | Excel Programming | |||
VBA-Select several ranges using variables | Excel Programming |