Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default question about syntax in a simple macro...

I just recorded the following macro:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/3/2006 by df78700
'

'
Cells.Select
Range("A8").Activate
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

I'm trying to select the entire worksheet and then create a new workbook and
paste all the cell values (not formulas) into that new workbook. This seems
to work fine, however, Range("A8") confuses me: obviously the range of an
entire XL worksheet is not one cell!

What am I missing here?
--
Brevity is the soul of wit.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 611
Default question about syntax in a simple macro...

Dave,

This is about activating a cell and selecting cells. Lots of cells can be
selected, but only one, the white one, is active. You've activated A8, but
a selection has never been made So without a selection, the Copy method puts
all the cells on the clipboard. If you add something like
Range("A7").Select first, then Range("A8").Activate will also select A8, and
your macro will copy/paste only A8. Better yet, change Range("A8).Activate
to Range("A8").Select.

--
Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"Dave F" wrote in message
...
I just recorded the following macro:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/3/2006 by df78700
'

'
Cells.Select
Range("A8").Activate
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

I'm trying to select the entire worksheet and then create a new workbook
and
paste all the cell values (not formulas) into that new workbook. This
seems
to work fine, however, Range("A8") confuses me: obviously the range of an
entire XL worksheet is not one cell!

What am I missing here?
--
Brevity is the soul of wit.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 947
Default question about syntax in a simple macro...

Hi.

ActiveSheet.Copy

Will copy the sheet to a new Workbook.

If you select a small area, you will see that 1 cell is always "active,"
even though you have selected more than 1 cell.
--
HTH :)
Dana DeLouis
Windows XP & Office 2003


"Dave F" wrote in message
...
I just recorded the following macro:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 11/3/2006 by df78700
'

'
Cells.Select
Range("A8").Activate
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

I'm trying to select the entire worksheet and then create a new workbook
and
paste all the cell values (not formulas) into that new workbook. This
seems
to work fine, however, Range("A8") confuses me: obviously the range of an
entire XL worksheet is not one cell!

What am I missing here?
--
Brevity is the soul of wit.



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
question on macro Harry Excel Discussion (Misc queries) 8 April 13th 06 05:25 PM
Macro Button Question mariat Excel Discussion (Misc queries) 4 December 1st 05 03:21 AM
Simple Hyperlink Macro Rebecca New Users to Excel 3 April 10th 05 09:21 AM
New Excel user needs help with simple Macro... Rahim Kassam New Users to Excel 1 January 24th 05 03:10 PM
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 08:37 PM


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

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

About Us

"It's about Microsoft Excel"