Excel button on each row

argonx

New Member
Joined
Feb 12, 2016
Messages
7
Greetings,

I try to find a way to make buttons that will copy row content to other worksheet in same file to different cells when I press on "COPY"
The button should be cell and dynamic because of large number of rows (more than 3000)

Here is example
mMxhoxc.png


[TABLE="width: 401"]
<tbody>[TR]
[/TR]
[TR]
[/TR]
[TR]
[TD][/TD]
[TD="class: xl64, align: left"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="class: xl64, align: left"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="class: xl64, align: left"][/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 401"]
<tbody>[TR]
[/TR]
</tbody>[/TABLE]


 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Welcome to the Board!

You do NOT want to have 3000 buttons. That would be quite a mess!

Here is what I recommend doing:
- Put one button at the top, and Freeze Panes so that the row at the top where the button exists is always visible
- Program your button to either copy the current/active row, or prompt the user to enter the row number to copy
 
Upvote 0
Instead of making all those buttons, you could use the DoubleClick event. Double click on a cell in the data region and the routine would copy/transpsose to the other sheet.

Its not clear what cells you want copy/transposed to the other sheet or where on the other sheet you want the copy put.
 
Last edited:
Upvote 0
Instead of making all those buttons, you could use the DoubleClick event. Double click on a cell in the data region and the routine would copy/transpsose to the other sheet.

Its not clear what cells you want copy/transposed to the other sheet or where on the other sheet you want the copy put.
Thanks @mikerickson,

Is it possible to get example considering I want to copy values like this:
FROM: B22 on sheet "start" to C18 on sheet "result"
FROM: B24 on sheet "start" to D12 on sheet "result"
FROM: A11 on sheet "start" to E1 on sheet "result"


Welcome to the Board!

You do NOT want to have 3000 buttons. That would be quite a mess!

Here is what I recommend doing:
- Put one button at the top, and Freeze Panes so that the row at the top where the button exists is always visible
- Program your button to either copy the current/active row, or prompt the user to enter the row number to copy

Thank You @Joe4 for Your advice,
Like I said to @mikerickson, is it possible to get example?
 
Upvote 0
I was going to ask you for an example showing two or three data blocks (and their inter-block blank rows (if any))
And where on Result do you want this, do you want it added to an exsting data or overwriting the existing data?
 
Upvote 0
I was going to ask you for an example showing two or three data blocks (and their inter-block blank rows (if any))
And where on Result do you want this, do you want it added to an exsting data or overwriting the existing data?

Here,

I will upload example of what I need
I example, I made list and in result is "Computer" item copied, I would need double click event on each row, when I click it to fill up "result" worksheet with values from "start" sheet on that row (etc. Orange, Hammer, Water....)
And Yes, overwriting existing data...

https://filetea.me/t1sGxK73O1bQQuPmiDUncQmFQ

or:
TinyUpload.com - best file hosting solution, with no limits, totaly free
 
Upvote 0
Your uploaded file shows only one block of data in A4:H9 (With header row).
Your request for many buttons suggests that there will be many blocks of data,
Where would the second (and other) blocks of data be and will each of those blocks have headers.
 
Upvote 0
Your uploaded file shows only one block of data in A4:H9 (With header row).
Your request for many buttons suggests that there will be many blocks of data,
Where would the second (and other) blocks of data be and will each of those blocks have headers.

It will contain only one header so far and I would make it first row and freeze.
All data will be in one block and formatted as rows in example (just will contain more information) but I will adjust formula

BR
 
Upvote 0
In your post #1 you show a image of only rows 1,2,3
Show us your script in the copy button that would copy these rows from sheet start to sheet result
 
Upvote 0
In your post #1 you show a image of only rows 1,2,3
Show us your script in the copy button that would copy these rows from sheet start to sheet result

I don't have that, if someone can help me make it, maybe on double click event

So I would need something like this:

Private Sub Copy()
Sheets("start").Select
Range("COLUMN "B" and row same as selection (from double click event)").Select
Selection.Copy
Sheets("result").Select
Range("C5").PasteSpecial Paste:=xlPasteValues
Sheets("start").Select
Range("COLUMN "C" and row same as selection (from double click event)").Select
Selection.Copy
Sheets("result").Select
Range("C6").PasteSpecial Paste:=xlPasteValues
Sheets("start").Select
Range("COLUMN "D" and row same as selection (from double click event)").Select
Selection.Copy
Sheets("result").Select
Range("C7").PasteSpecial Paste:=xlPasteValues
End Sub

And so on
 
Upvote 0

Forum statistics

Threads
1,225,594
Messages
6,185,889
Members
453,333
Latest member
BioCoder84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top