ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Creating A spreadsheet with an Update Function (https://www.excelbanter.com/excel-discussion-misc-queries/129607-creating-spreadsheet-update-function.html)

tj

Creating A spreadsheet with an Update Function
 
I am trying to create a spreadsheet with 2 active sheets. I would like an
Update Button on Sheet 1. Based on certain information that is entered on
Sheet 1, when the Update Button is pressed, the information would then be
automatically copied into Sheet 2. Can someone tell me how to accomplish
this? It would be greatly appreciated!
--
TJ

ufo_pilot

Creating A spreadsheet with an Update Function
 
On sheet1, create a shape ( your button )
you can add the text "update on it if you wish
then either edit the code below to suit your needs, or better create a
quick macro for yourself:
TOOLS MACRORECORD NEW MACRO ( you can name it)
then do exactly what you want the macro to do, ie: copy cells, select
another sheet, paste or paste special where you want the data, return to
sheet1
now STOP RECORDING ( there will be an icon, or go to
TOOLS MACRO STOP RECORDING

Now right click on your autoshape ( button) assign macro, select the macro
you wrote....


Sub Update()
Range("A1:F21").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Sheets("Sheet1").Select
Application.CutCopyMode = False
Range("A1").Select
End Sub

"TJ" wrote:

I am trying to create a spreadsheet with 2 active sheets. I would like an
Update Button on Sheet 1. Based on certain information that is entered on
Sheet 1, when the Update Button is pressed, the information would then be
automatically copied into Sheet 2. Can someone tell me how to accomplish
this? It would be greatly appreciated!
--
TJ


tj

Creating A spreadsheet with an Update Function
 
Thank you for your assistance.
--
TJ


"ufo_pilot" wrote:

On sheet1, create a shape ( your button )
you can add the text "update on it if you wish
then either edit the code below to suit your needs, or better create a
quick macro for yourself:
TOOLS MACRORECORD NEW MACRO ( you can name it)
then do exactly what you want the macro to do, ie: copy cells, select
another sheet, paste or paste special where you want the data, return to
sheet1
now STOP RECORDING ( there will be an icon, or go to
TOOLS MACRO STOP RECORDING

Now right click on your autoshape ( button) assign macro, select the macro
you wrote....


Sub Update()
Range("A1:F21").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Sheets("Sheet1").Select
Application.CutCopyMode = False
Range("A1").Select
End Sub

"TJ" wrote:

I am trying to create a spreadsheet with 2 active sheets. I would like an
Update Button on Sheet 1. Based on certain information that is entered on
Sheet 1, when the Update Button is pressed, the information would then be
automatically copied into Sheet 2. Can someone tell me how to accomplish
this? It would be greatly appreciated!
--
TJ



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

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