Looping a Macro

  • Thread starter Thread starter Al
  • Start date Start date
A

Al

Hi I want to use a macro to create some inoput boxes for users to enter
data. I can create the boxes and enter the first set of data. however what
is the best way to loop the macro so that I can =enter a second and
subsequnet record please

thanks
Al
 
One way might be to use a UserForm rather than a series of InputBoxes. On
clicking the Enter button, the code would simply write the values in the
TextBoxes into your spreadsheet and clear them for the next data entry.
When done, clicking the Exit button would close the form.

Ed
 
Hi both

thanks for your post

yes I agree that using Data Form is probably the best way - I was trying to
explain the use of input boxes, but at the end of the day I guess its better
to use built in functionality that cobble something together which will do
the same job only a lot worse

Thanks

Al
 
Dave

Thanks for your post

yes I did realise that but given the level users are at, think that probably
Data Form is best option. However your link very much apprteciatre and
stored carefully in my list of useful documents - thanks for that

One other question if I may: When I go to c reate a macro using data form,
and having selected just colum headings, how can I stop the Excel edrror
message coming up saying that it doesn't know which rows are the headings.
The macrfo code is as follows:
Range("A2:G2").Select
ActiveSheet.ShowDataForm

Thanks A
 
application.displayalerts = false
ActiveSheet.ShowDataForm
application.displayalerts = true

could work for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top