Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Better way to write this

without actually having to select a sheet?

Worksheets("HR DB").Range("A5:BJ" & Range("B1499").End(xlUp).Row).Copy
Workbooks.Add
ActiveSheet.Select
Selection.PasteSpecial Paste:=xlPasteValues


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default Better way to write this

Steph

Just change it to

Worksheets("HR DB").Range("A5:BJ" & Range("B1499").End(xlUp).Row).Copy
Workbooks.Add
activeworkbook.WorkSheets(1).Range("A1").PasteSpec ial Paste:=xlPasteValues

Alok Joshi

"Steph" wrote:

without actually having to select a sheet?

Worksheets("HR DB").Range("A5:BJ" & Range("B1499").End(xlUp).Row).Copy
Workbooks.Add
ActiveSheet.Select
Selection.PasteSpecial Paste:=xlPasteValues



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Better way to write this

One way:

With Sheets("HR DB").Range("A5:BJ" & Range("B1499").End(xlUp).Row)
Workbooks.Add.Sheets(1).Range("A1").Resize( _
.Rows.Count, .Columns.Count).Value = .Value
End With


In article ,
"Steph" wrote:

Worksheets("HR DB").Range("A5:BJ" & Range("B1499").End(xlUp).Row).Copy
Workbooks.Add
ActiveSheet.Select
Selection.PasteSpecial Paste:=xlPasteValues

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to write value vincent Excel Discussion (Misc queries) 1 March 18th 10 04:28 AM
how to write ‘  murugan Excel Discussion (Misc queries) 2 August 19th 08 01:45 PM
Write to csv Jeff Excel Discussion (Misc queries) 0 November 21st 07 07:00 PM
How do I write X^2? webb New Users to Excel 2 October 15th 07 08:21 AM
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM


All times are GMT +1. The time now is 06:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"