ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I get a macro to opperate from a different sheet (https://www.excelbanter.com/excel-discussion-misc-queries/256122-how-can-i-get-macro-opperate-different-sheet.html)

Chris

How can I get a macro to opperate from a different sheet
 
I am tring to set up a macro on sheet 11 that will change values in sheet 13
of my work book. I have set up a button on sheet13 that transfers values from
1 range of cells to another range of cells. Is it posible to have the button
work from sheet 11 instead of sheet 13. This is the macro I have for sheet
13.

Thanks for your help
regards
Chris


Sub update()

ActiveSheet.Range("I20:I23").Copy
Range("F20").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub



Gary Keramidas[_3_]

How can I get a macro to opperate from a different sheet
 
untested, but give it a try

Worksheets(11).Range("I20:I23").Copy
worksheets(13).Range("F20").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub


--


Gary Keramidas
Excel 2003


"Chris" wrote in message
...
I am tring to set up a macro on sheet 11 that will change values in sheet
13
of my work book. I have set up a button on sheet13 that transfers values
from
1 range of cells to another range of cells. Is it posible to have the
button
work from sheet 11 instead of sheet 13. This is the macro I have for
sheet
13.

Thanks for your help
regards
Chris


Sub update()

ActiveSheet.Range("I20:I23").Copy
Range("F20").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub




Vital_ar[_2_]

How can I get a macro to opperate from a different sheet
 
Dear Chris,
Just add this,
Worksheets("Sheet13").Activate

and then you macro will be

Sub update()
Worksheets("Sheet13").Activate
ActiveSheet.Range("I20:I23").Copy
Range("F20").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub

Regards

"Chris" wrote:

I am tring to set up a macro on sheet 11 that will change values in sheet 13
of my work book. I have set up a button on sheet13 that transfers values from
1 range of cells to another range of cells. Is it posible to have the button
work from sheet 11 instead of sheet 13. This is the macro I have for sheet
13.

Thanks for your help
regards
Chris


Sub update()

ActiveSheet.Range("I20:I23").Copy
Range("F20").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub



Chris

How can I get a macro to opperate from a different sheet
 
Hi Garry
Thanks for that, had to change it a little in the first part from
Worksheet(11) to Worksheet(13).

"Gary Keramidas" wrote:

untested, but give it a try

Worksheets(11).Range("I20:I23").Copy
worksheets(13).Range("F20").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub


--


Gary Keramidas
Excel 2003


"Chris" wrote in message
...
I am tring to set up a macro on sheet 11 that will change values in sheet
13
of my work book. I have set up a button on sheet13 that transfers values
from
1 range of cells to another range of cells. Is it posible to have the
button
work from sheet 11 instead of sheet 13. This is the macro I have for
sheet
13.

Thanks for your help
regards
Chris


Sub update()

ActiveSheet.Range("I20:I23").Copy
Range("F20").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub



.



All times are GMT +1. The time now is 11:51 AM.

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