Excel-Macro Help

Tags:
Excel macros
Microsoft Excel
VBA
I'm creating a spreadsheet for a business (for my uni work) and i need to create a booking form and from that be able to save the customers information. I've created the booking form, and created a button to save the customer information, using a macro for it to save. The problem is when the buttons clicked, regardless of if the information has changed in the booking form, it overwrites the first customer, it copies to the same cells. Any help? I'm not allowed to use Acess, Excel only.~ Thank you.

Answer Wiki

Thanks. We'll let you know when a new response is added.

I assume that the data from the form needs to go in the next row of an Excel sheet?

You’ll want to declare a variable then loop through looking for the next blank row. Something like this will be what you are looking for.

<pre>dim i as integer
do until range(“A” & i).value = “” ‘Change A to what ever column you need to monitor.
i = i + 1
loop</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following