Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy changing group of cells from Sheet1 to Sheet2
I have a logical group of cells in Sheet1 that can change in size over time
(new cells are added, old cells are removed) I would like to have a way to copy this group of cells from Sheet1 into Sheet2 with the push of a button. (Keep in mind that the number of cells fluctuate) I am curious if anyone else has ever run into this and if there is a VBA example of how they handled it. Thanks in advance for your assistance. Brad |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy changing group of cells from Sheet1 to Sheet2
Create your command button from the Control Toolbox, then in design mode
right click the button and select View Code from the drop down list. Copy the code below into the code window that opens. Private Sub CommandButton1_Click() Sheets(1).ActiveCell.CurrentRange.Copy _ Sheets(2).Range("A1") Application.CutCopyMode = False End Sub Exit design mode, select a cell in the range, then click the button. "Brad" wrote in message ... I have a logical group of cells in Sheet1 that can change in size over time (new cells are added, old cells are removed) I would like to have a way to copy this group of cells from Sheet1 into Sheet2 with the push of a button. (Keep in mind that the number of cells fluctuate) I am curious if anyone else has ever run into this and if there is a VBA example of how they handled it. Thanks in advance for your assistance. Brad |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy changing group of cells from Sheet1 to Sheet2
Had my mind on range, needed region. Use this modified version.
Private Sub CommandButton1_Click() Sheets(1).ActiveCell.CurrentRegion.Copy _ Sheets(2).Range("A1") Application.CutCopyMode = False End Sub "Brad" wrote in message ... I have a logical group of cells in Sheet1 that can change in size over time (new cells are added, old cells are removed) I would like to have a way to copy this group of cells from Sheet1 into Sheet2 with the push of a button. (Keep in mind that the number of cells fluctuate) I am curious if anyone else has ever run into this and if there is a VBA example of how they handled it. Thanks in advance for your assistance. Brad |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy changing group of cells from Sheet1 to Sheet2
JLGWhiz,
Thanks for the help. I can't wait to get into work to try this. I am fairly new to Excel and really new at VBA. I have a lot to learn. This is probably a really dumb question. How do you establish a "Region" in Sheet1? Thanks again, Brad "JLGWhiz" wrote: Had my mind on range, needed region. Use this modified version. Private Sub CommandButton1_Click() Sheets(1).ActiveCell.CurrentRegion.Copy _ Sheets(2).Range("A1") Application.CutCopyMode = False End Sub "Brad" wrote in message ... I have a logical group of cells in Sheet1 that can change in size over time (new cells are added, old cells are removed) I would like to have a way to copy this group of cells from Sheet1 into Sheet2 with the push of a button. (Keep in mind that the number of cells fluctuate) I am curious if anyone else has ever run into this and if there is a VBA example of how they handled it. Thanks in advance for your assistance. Brad |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy data from sheet2 to sheet1 when sheet2 has variable # of rows | Excel Discussion (Misc queries) | |||
Auto Copy from Sheet1 to Sheet2 | Excel Programming | |||
A1 Sheet2 is linked to A1 sheet1 so that user enters value(abc123) a1 sheet1 and A1 sheet2 is updated | Excel Programming | |||
List a group of repeated data from sheet1 to sheet2 but not repeat | New Users to Excel | |||
Copy result from sheet1 to sheet2 | Excel Discussion (Misc queries) |