Format in VBA for a Save Button picture (Excel 2016)

Jaycee01

New Member
Joined
Sep 16, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone,

I need your help. I'm currently creating a tracker but I'm stuck on creating VBA for a picture button I created to save the data from sheet1 to sheet2.

Can you help me create something so I can run the save button to copy what I entered on the black spaces to sheet 2?

Thank you!
 

Attachments

  • save.PNG
    save.PNG
    28 KB · Views: 1

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
So I guess that you simulate on Sheet1 a form to help the user input Name, Property Name etc and would like creating a macro to be associaed to the Save button that would read the data on Sheet1 and copy them on Sheet2 on the first free row, from column A to the right
If this is your situation, then my suggestion is the following macro:
VBA Code:
Sub CopyForm()
Dim oSh As Worksheet, iArr As Variant, myNext As Long
'
Set oSh = Sheets("Sheet2")              '<<< The sheet to paste datas
iArr = Array("H5", "E5", "E7", "E9")    '<<< The complete list of cells
'
myNext = oSh.Cells(Rows.Count, "A").End(xlUp).Row + 1
For I = 0 To UBound(iArr)
    Range(iArr(I)).Copy Destination:=oSh.Cells(myNext, I + 1)
Next I
End Sub


As far as the Reset button:
VBA Code:
Sub ResetArea()
    Range("H5, E5, E7, E9").ClearContents       '<<< The complete cells list
End Sub

Bye
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,383
Members
448,955
Latest member
BatCoder

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