Excel/VB Copy Range with Lastrow to new workbook
Don't know if you have time or not but I was wondering if you could help with the following query;
I need to copy a range, "I3" to lastrow to a new workbook. The workbook name containing the values will change.
The range I:3 to say I:16000 then needs to be pasted as values and saved as a txt and should default into "C:\Documents and Settings\ etc.
I have seen numerous bits of code but can't seem to put it together to perform this task.
Any help would be really appreciated
Many thanks for you time
I have no way to determine what the name of your destination workbook is so I will give you an example with a known name.
Dim bk as workbook, sh as worksheet
set bk = workbooks("MyBooks.xlsx")
set sh = bk.worksheets("Sheet1")
bk.SaveAs "C:\Documents and Settings\MyNewBook.txt Fileformat:=xlTextWindows
perhaps that will help you put it together. I assume the destination workbook has only a single sheet in it.
When you run the macro it assumes the activesheet is the sheet that has the data in I3:I6000
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here