Creating A spreadsheet with an Update Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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> MACRO>RECORD 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
 
Thank you for your assistance.
--
TJ


ufo_pilot said:
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> MACRO>RECORD 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
 
Back
Top