#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Cool Macro

Thanks Jarek. This last macro: Sub kopiuj()

For Each Worksheet In ActiveWorkbook.Worksheets
i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then
Worksheets(i).Range("M6").Copy
Worksheets(ActiveWorkbook.Worksheets.Count).Cells( i, 1).PasteSpecial
Paste=xlValues
End If
Next

End Sub

is a saver. Notice I removed the colon for it to work. Can this macro be
tweaked further to paste values to a new workbook instead of a worksheet.
Just asking.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Cool Macro

Dim sh As Worksheet
Dim wb As Workbook

Set wb = Workbooks.Add
For Each sh In ActiveWorkbook.Worksheets

i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then

Worksheets(i).Range("M6").Copy
wb.Worksheets(1).Cells(i, 1).PasteSpecial Paste:=xlValues
End If
Next


--
__________________________________
HTH

Bob

"carla 7" wrote in message
...
Thanks Jarek. This last macro: Sub kopiuj()

For Each Worksheet In ActiveWorkbook.Worksheets
i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then
Worksheets(i).Range("M6").Copy
Worksheets(ActiveWorkbook.Worksheets.Count).Cells( i, 1).PasteSpecial
Paste=xlValues
End If
Next

End Sub

is a saver. Notice I removed the colon for it to work. Can this macro be
tweaked further to paste values to a new workbook instead of a worksheet.
Just asking.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default Cool Macro

1. the browser broke that line

2. yes, it can
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Cool Macro

The macro did create a new workbook but did not copy the values from the
worksheets over. Thanks anyway.

"Bob Phillips" wrote:

Dim sh As Worksheet
Dim wb As Workbook

Set wb = Workbooks.Add
For Each sh In ActiveWorkbook.Worksheets

i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then

Worksheets(i).Range("M6").Copy
wb.Worksheets(1).Cells(i, 1).PasteSpecial Paste:=xlValues
End If
Next


--
__________________________________
HTH

Bob

"carla 7" wrote in message
...
Thanks Jarek. This last macro: Sub kopiuj()

For Each Worksheet In ActiveWorkbook.Worksheets
i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then
Worksheets(i).Range("M6").Copy
Worksheets(ActiveWorkbook.Worksheets.Count).Cells( i, 1).PasteSpecial
Paste=xlValues
End If
Next

End Sub

is a saver. Notice I removed the colon for it to work. Can this macro be
tweaked further to paste values to a new workbook instead of a worksheet.
Just asking.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Cool Macro

Perhaps it needs this tweak

Dim sh As Worksheet
Dim wb As Workbook
Dim this As Workbook

Set this = ActiveWorkbook
Set wb = Workbooks.Add
For Each sh In this.Worksheets

i = i + 1
If i < this.Worksheets.Count Then

this.Worksheets(i).Range("M6").Copy
wb.Worksheets(1).Cells(i, 1).PasteSpecial Paste:=xlValues
End If
Next


--
__________________________________
HTH

Bob

"Bob Phillips" wrote in message
...
Dim sh As Worksheet
Dim wb As Workbook

Set wb = Workbooks.Add
For Each sh In ActiveWorkbook.Worksheets

i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then

Worksheets(i).Range("M6").Copy
wb.Worksheets(1).Cells(i, 1).PasteSpecial Paste:=xlValues
End If
Next


--
__________________________________
HTH

Bob

"carla 7" wrote in message
...
Thanks Jarek. This last macro: Sub kopiuj()

For Each Worksheet In ActiveWorkbook.Worksheets
i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then
Worksheets(i).Range("M6").Copy
Worksheets(ActiveWorkbook.Worksheets.Count).Cells( i, 1).PasteSpecial
Paste=xlValues
End If
Next

End Sub

is a saver. Notice I removed the colon for it to work. Can this macro be
tweaked further to paste values to a new workbook instead of a worksheet.
Just asking.







  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Cool Macro


Another lifesaving macro...question though, instead of the values being
placed in different workbooks after each time the macro is run, can they be
placed in the destination workbook where the values were first pasted?

Excitedly curious....
"Bob Phillips" wrote:

Perhaps it needs this tweak

Dim sh As Worksheet
Dim wb As Workbook
Dim this As Workbook

Set this = ActiveWorkbook
Set wb = Workbooks.Add
For Each sh In this.Worksheets

i = i + 1
If i < this.Worksheets.Count Then

this.Worksheets(i).Range("M6").Copy
wb.Worksheets(1).Cells(i, 1).PasteSpecial Paste:=xlValues
End If
Next


--
__________________________________
HTH

Bob

"Bob Phillips" wrote in message
...
Dim sh As Worksheet
Dim wb As Workbook

Set wb = Workbooks.Add
For Each sh In ActiveWorkbook.Worksheets

i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then

Worksheets(i).Range("M6").Copy
wb.Worksheets(1).Cells(i, 1).PasteSpecial Paste:=xlValues
End If
Next


--
__________________________________
HTH

Bob

"carla 7" wrote in message
...
Thanks Jarek. This last macro: Sub kopiuj()

For Each Worksheet In ActiveWorkbook.Worksheets
i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then
Worksheets(i).Range("M6").Copy
Worksheets(ActiveWorkbook.Worksheets.Count).Cells( i, 1).PasteSpecial
Paste=xlValues
End If
Next

End Sub

is a saver. Notice I removed the colon for it to work. Can this macro be
tweaked further to paste values to a new workbook instead of a worksheet.
Just asking.






  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Cool Macro

You would have to have some ay of knowing which workbook that was, and where
it was.

--
__________________________________
HTH

Bob

"carla 7" wrote in message
...

Another lifesaving macro...question though, instead of the values being
placed in different workbooks after each time the macro is run, can they
be
placed in the destination workbook where the values were first pasted?

Excitedly curious....
"Bob Phillips" wrote:

Perhaps it needs this tweak

Dim sh As Worksheet
Dim wb As Workbook
Dim this As Workbook

Set this = ActiveWorkbook
Set wb = Workbooks.Add
For Each sh In this.Worksheets

i = i + 1
If i < this.Worksheets.Count Then

this.Worksheets(i).Range("M6").Copy
wb.Worksheets(1).Cells(i, 1).PasteSpecial Paste:=xlValues
End If
Next


--
__________________________________
HTH

Bob

"Bob Phillips" wrote in message
...
Dim sh As Worksheet
Dim wb As Workbook

Set wb = Workbooks.Add
For Each sh In ActiveWorkbook.Worksheets

i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then

Worksheets(i).Range("M6").Copy
wb.Worksheets(1).Cells(i, 1).PasteSpecial Paste:=xlValues
End If
Next


--
__________________________________
HTH

Bob

"carla 7" wrote in message
...
Thanks Jarek. This last macro: Sub kopiuj()

For Each Worksheet In ActiveWorkbook.Worksheets
i = i + 1
If i < ActiveWorkbook.Worksheets.Count Then
Worksheets(i).Range("M6").Copy
Worksheets(ActiveWorkbook.Worksheets.Count).Cells( i, 1).PasteSpecial
Paste=xlValues
End If
Next

End Sub

is a saver. Notice I removed the colon for it to work. Can this macro
be
tweaked further to paste values to a new workbook instead of a
worksheet.
Just asking.







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
Uploading excel files: Useful and Cool Albert Excel Discussion (Misc queries) 1 September 14th 06 05:19 PM
Cool Feature - How do I do it? mnt Excel Discussion (Misc queries) 3 March 24th 06 06:23 PM
Can anyone tell me something really cool that Excel can do? Kevin Excel Discussion (Misc queries) 4 March 7th 06 03:15 AM
I found this cool link Gogogo Excel Worksheet Functions 0 January 13th 06 04:11 PM
Went to your site pretty cool! Marc New Users to Excel 0 December 2nd 04 03:51 AM


All times are GMT +1. The time now is 04:36 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"