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 |
All times are GMT +1. The time now is 03:39 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com