Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Clearing Form / Showing message that data was stored

0

Good Evening,

I wonder if you can help me in order to have the additional part of the macro that you create called (Input Form to Get Data and Store it in Another Tab in Excel), as you mentioned at the end of this macro I would like to have the instructions in order to: Clearing the form when a successful entry has been made and showing an output message that the data was stored.

I'm copying below the VBA macro that you wrote for reference,

Thanks in advance for your help!

Sub data_input()
ws_output = "Data"
next_row = Sheets(ws_output).Range("A" & Rows.Count).End(xlUp).Offset(1).Row
Sheets(ws_output).Cells(next_row, 1).Value = Range("first_name").Value
Sheets(ws_output).Cells(next_row, 2).Value = Range("last_name").Value
Sheets(ws_output).Cells(next_row, 3).Value = Range("email").Value
Sheets(ws_output).Cells(next_row, 4).Value = Range("account").Value
End Sub
Post Edited
CODE Tags: You must add [CODE][/CODE] tags around your code! (click the CODE button to do this when creating a post)
Answer
Discuss

Answers

0

To clear any cell on the current worksheet, use this code:

Range("A1").Value = ""

Change A1 to the desired cell reference and input this line as many times as is needed.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login