Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default copy value to all pages

Thanks for your reply...
Had to modify a bit because the workbook is password protected so I wrote:

Sub Test()
Dim I As Long
ActiveSheet.Unprotect Password="DBI"
For I = 2 To ThisWorkbook.Worksheets.Count
Worksheets(1).Range("A1:A3").Copy Worksheets(I).Range("A1:A3")
Next
ActiveSheet.Protect Password="DBI"
End Sub

This seems to work, but cells A1 to A3 are blocked too.
There must be a way to unblock them, perform the copying and block them again.
Alas, I don't know how.
Maybe you do.
Thanks in advance
JP, Belgium


"Ron de Bruin" wrote in message ...
You can use this macro

Sub Test()
Dim I As Long
For I = 2 To ThisWorkbook.Worksheets.Count
Worksheets(1).Range("A1:A3").Copy Worksheets(I).Range("A1")
Next
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jean-Paul De Winter" wrote in message ...
Hi,
I would like to have a puchbutton on the first page of my worksheet that,
when puched, copies cells A1,A2 and A3 to evey page of the worksheet...
Can somebody explain how?
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default copy value to all pages

Use this

protect and unprotect in the loop

Sub Test()
Dim I As Long
For I = 2 To ThisWorkbook.Worksheets.Count
Worksheets(I).Unprotect Password = "DBI"
Worksheets(1).Range("A1:A3").Copy Worksheets(I).Range("A1:A3")
Worksheets(I).Protect Password = "DBI"
Next
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jean-Paul De Winter" wrote in message om...
Thanks for your reply...
Had to modify a bit because the workbook is password protected so I wrote:

Sub Test()
Dim I As Long
ActiveSheet.Unprotect Password="DBI"
For I = 2 To ThisWorkbook.Worksheets.Count
Worksheets(1).Range("A1:A3").Copy Worksheets(I).Range("A1:A3")
Next
ActiveSheet.Protect Password="DBI"
End Sub

This seems to work, but cells A1 to A3 are blocked too.
There must be a way to unblock them, perform the copying and block them again.
Alas, I don't know how.
Maybe you do.
Thanks in advance
JP, Belgium


"Ron de Bruin" wrote in message ...
You can use this macro

Sub Test()
Dim I As Long
For I = 2 To ThisWorkbook.Worksheets.Count
Worksheets(1).Range("A1:A3").Copy Worksheets(I).Range("A1")
Next
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jean-Paul De Winter" wrote in message ...
Hi,
I would like to have a puchbutton on the first page of my worksheet that,
when puched, copies cells A1,A2 and A3 to evey page of the worksheet...
Can somebody explain how?
Thanks




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
Copy headers and footers to other pages? Laura Excel Worksheet Functions 1 August 3rd 07 10:10 PM
Copy the same cell from numerouse pages the-jackal New Users to Excel 4 February 26th 06 01:40 PM
Copy a formula to 15 pages ED New Users to Excel 1 January 20th 06 02:11 PM
Copy pages from one worksheet to another Sam Fowler[_2_] Excel Programming 2 April 10th 04 03:34 AM
Auto Choosing Pages to Copy Sam Fowler[_2_] Excel Programming 2 April 3rd 04 03:11 PM


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