Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default copy row including the button

i need to have a button at the beginning of each row, that copies the
row that the button is on to the next row below it.....

but when i copy a row to the next line, it doesnt copy the button. it
will copy it if im in design mode, but this worksheet is for other
users and it will be protected and not allowed to go into design mode.
can this be done?

(on a sidenote....is it possible to snap a button into a cell, making
the entire cell a button?)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default copy row including the button

Use a CommandButton not a form button.
They copy with the code too.

--
Regards

Corey
"Nigel" wrote in message
ps.com...
i need to have a button at the beginning of each row, that copies the
row that the button is on to the next row below it.....

but when i copy a row to the next line, it doesnt copy the button. it
will copy it if im in design mode, but this worksheet is for other
users and it will be protected and not allowed to go into design mode.
can this be done?

(on a sidenote....is it possible to snap a button into a cell, making
the entire cell a button?)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default copy row including the button

I take it you are using a worksheet control from the controls toolbox menu.
By default these are formatted to "Move but don't size with cells". You
could change to "Move & size with cells" but a copied button will not be
linked to any code. There are ways to do that but problems can occur
(particularly if doing on the active sheet).

Suggest use a Forms button and ensure format is "Move but don't size with
cells".

(on a sidenote....is it possible to snap a button into a cell, making
the entire cell a button?)


There is a snap to grid icon, customize toolbars Drawing toolbar. Or, try
holding Alt when repositioning / resizing. Otherwise programmatically be
setting size to cell dimensions.

Regards,
Peter T

"Nigel" wrote in message
ps.com...
i need to have a button at the beginning of each row, that copies the
row that the button is on to the next row below it.....

but when i copy a row to the next line, it doesnt copy the button. it
will copy it if im in design mode, but this worksheet is for other
users and it will be protected and not allowed to go into design mode.
can this be done?

(on a sidenote....is it possible to snap a button into a cell, making
the entire cell a button?)



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default copy row including the button

ok so this is what i have so far....

Sub AddSize()
Set r = ActiveSheet.Buttons(Application.Caller).TopLeftCel l
rowNum = r.Row
cellValue = r.Value
Rows(rowNum).Select
Selection.Copy
Selection.Insert Shift:=xlDown
End Sub

its pretty buggy tho....
first thing, is that it copies the last row rather than the row the
button is on. every row has its own button so any row could be copied,
but it always just copies the last row. Which is wierd because it
doesnt seem like there is anything that would tell it to find the last
row.

also when it copies the row, for some reason it creates a button that i
cant delete....ive tried everything......right clickcut......design
mode (even tho its a form button and not a control toolbox
button)......when i manually copy and insert a new row, i can delete
the button, so i thinks it something in the code...

any thoughts? thnx

On Nov 10, 3:43 am, "Peter T" <peter_t@discussions wrote:
I take it you are using a worksheet control from the controls toolbox menu.
By default these are formatted to "Move but don't size with cells". You
could change to "Move & size with cells" but a copied buttonwill not be
linked to any code. There are ways to do that but problems can occur
(particularly if doing on the active sheet).

Suggest use a Formsbuttonand ensure format is "Move but don't size with
cells".

(on a sidenote....is it possible to snap abuttoninto a cell, making
the entire cell abutton?)There is a snap to grid icon, customize toolbars Drawing toolbar. Or, try

holding Alt when repositioning / resizing. Otherwise programmatically be
setting size to cell dimensions.

Regards,
Peter T

"Nigel" wrote in glegroups.com...

i need to have abuttonat the beginning of eachrow, that copies the
rowthat thebuttonis on to the nextrowbelowit.....


but when icopyarowto the next line, it doesntcopythebutton. it
willcopyit if im in design mode, but this worksheet is for other
users and it will be protected and not allowed to go into design mode.
can this be done?


(on a sidenote....is it possible to snap abuttoninto a cell, making
the entire cell abutton?)


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 contents including colour gramps Excel Discussion (Misc queries) 3 May 1st 10 12:35 PM
copy worksheet without including vba code cedtech23[_15_] Excel Programming 2 July 23rd 06 10:58 AM
How do I copy the print settings, including header and footer fro. bruce Excel Discussion (Misc queries) 4 May 26th 06 07:55 PM
copy rows that contain certain text to a new sheet including the h mike Excel Programming 4 December 5th 05 02:31 PM
How do I copy all of excel file including header Donna Excel Programming 1 September 22nd 05 05:00 PM


All times are GMT +1. The time now is 07:14 AM.

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"