Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to select cells dynamically in excel macro?
Following is the sample macro. I want to get 2 worksheets, one beside the
other on a single new worksheet. Sub Macro7() Workbooks.Open Filename:="C:\Sujatha\Excel\Jan_sales.xls" Application.Goto Reference:="JAN_SALES" Selection.Copy Windows("Book3.xls").Activate ActiveSheet.Paste Range("D1").Select Application.CutCopyMode = False Workbooks.Open Filename:="C:\Sujatha\Excel\Feb_sales.xls" Application.Goto Reference:="FEB_SALES" Selection.Copy Windows("Book3.xls").Activate ActiveSheet.Paste End Sub I have specified 'Range("D1").Select' explictly. Suppose I don't know where the first range ends, I want the macro to go to the last +2 columns and then make the next copy. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to select cells without a certain value and select a menu it | Excel Worksheet Functions | |||
How do I change the size of cells dynamically in Excel? | Excel Worksheet Functions | |||
Help with Dynamically changing Range in Excel Macro | Excel Discussion (Misc queries) | |||
dynamically select a range of cells for use in a formula | Excel Worksheet Functions | |||
How to dynamically select a validation list from data in a cell? | Excel Discussion (Misc queries) |