ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copying sheet (https://www.excelbanter.com/excel-programming/286297-copying-sheet.html)

Jan Eikeland

copying sheet
 
envir excel in office97, winxphome
hi,
i copy one sheet from another but code for commandbutton wont follow.
any tips?
thank you
regards jan



Bob Phillips[_6_]

copying sheet
 
Jan,

What type of CB is it, forms or control toolbox? I tried both (XP Pro,
XL2000), and they both copied the code, or macro assignment, as well.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Eikeland" wrote in message
...
envir excel in office97, winxphome
hi,
i copy one sheet from another but code for commandbutton wont follow.
any tips?
thank you
regards jan





Jan Eikeland

copying sheet
 
its control
reg jan
"Bob Phillips" skrev i melding
...
Jan,

What type of CB is it, forms or control toolbox? I tried both (XP Pro,
XL2000), and they both copied the code, or macro assignment, as well.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Eikeland" wrote in message
...
envir excel in office97, winxphome
hi,
i copy one sheet from another but code for commandbutton wont follow.
any tips?
thank you
regards jan







Bob Phillips[_6_]

copying sheet
 
Jan,

As I said, when I copied a worksheet the Control CB worksheet code came over
with it.

How did you do the copy?
Where is the code (what code module)?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Eikeland" wrote in message
...
its control
reg jan
"Bob Phillips" skrev i melding
...
Jan,

What type of CB is it, forms or control toolbox? I tried both (XP Pro,
XL2000), and they both copied the code, or macro assignment, as well.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Eikeland" wrote in message
...
envir excel in office97, winxphome
hi,
i copy one sheet from another but code for commandbutton wont follow.
any tips?
thank you
regards jan









Jan Eikeland

copying sheet
 
hi, heres the sub:

Private Sub CommandButton1_Click()
With Worksheets("Elever")
For Each Cell In .Range(.Cells(1, 7), .Cells(Rows.Count, 7).End(xlUp))
If Not IsEmpty(Cell) Then
Worksheets("Elevmal").Copy After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = Cell.Value
End If
Next
End With
End Sub
"Bob Phillips" skrev i melding
...
Jan,

As I said, when I copied a worksheet the Control CB worksheet code came

over
with it.

How did you do the copy?
Where is the code (what code module)?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Eikeland" wrote in message
...
its control
reg jan
"Bob Phillips" skrev i melding
...
Jan,

What type of CB is it, forms or control toolbox? I tried both (XP Pro,
XL2000), and they both copied the code, or macro assignment, as well.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jan Eikeland" wrote in message
...
envir excel in office97, winxphome
hi,
i copy one sheet from another but code for commandbutton wont

follow.
any tips?
thank you
regards jan











MSP77079[_8_]

copying sheet
 
Are you copying a sheet or copying a range?

If you are using:

ActiveSheet.Cells.Copy
'go to place you want to place you want to paste to, then
Range("A1").Select
ActiveSheet.Paste

You will get only information in the cells, not the command buttons,
and not any code written on the sheet.

On the other hand, if you are using:

Sheets(n).Copy After:=Workbooks("Book2").Sheets(i)

then, you should get all the data and the command buttons, and the code
written on the sheet.


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 10:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com