+ Reply to Thread
Results 1 to 2 of 2

Save lots of input data from Userform - Help with arrays *novice*

  1. #1
    Registered User
    Join Date
    04-30-2020
    Location
    Manchester, UK
    MS-Off Ver
    Professional Plus 2016
    Posts
    1

    Save lots of input data from Userform - Help with arrays *novice*

    Hi Guys,

    I have a working database which gathers a lot of values (72 I think) from Userform and saves them into the next empty row of a worksheet. Unfortunately, as there are so many values when I execute the save function suing the command button, it takes well over 20 seconds to save the values to the worksheet. It's almost like it crashes. I have a very good PC with high spec processor/ram but it's extremely slow.
    I've read a lot online about using arrays to speed up the saving process. I have past experience in programming with VB (18 years ago) and I managed to get this far but I have not got a clue where to start when it comes to arrays. Can anybody help?

    Here is the code that I have for the save funtion:

    Please Login or Register  to view this content.
    Excuse me if my coding technique is poor

    Many thanks

    Zac

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Save lots of input data from Userform - Help with arrays *novice*

    Hi Zac.

    You say that you are reading and writing 72 items of data to and from excel into a Userform.

    I would read a line of data into VBA using

    'Read Row 5 into VBA
    Please Login or Register  to view this content.

    I would then use the Array to load the Userform Controls

    Please Login or Register  to view this content.

    To write my Data Back to Row 5

    I would read my Controls Back into An Array and then write the Array to My Row

    Please Login or Register  to view this content.

    This only works if you number your controls with the column number that the data is stored in.
    However you can have several types of control loaded with the same data.

    Eg Label1.Caption = TextBox1.Text = Listbox1.value = Spinbutton1.value = Cells(5,1).value
    Last edited by mehmetcik; 05-06-2020 at 01:24 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. BIG sheet with lots and lots of data to filter...
    By Amatør in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-25-2016, 08:26 AM
  2. Excel Userform novice!!
    By Maggie6360 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 07-20-2015, 01:53 PM
  3. [SOLVED] Save data from UserForm into Sheet (how to resolve runtime errors in UserForm tutorial)
    By eighty6 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-14-2015, 07:41 PM
  4. How to browse the path for the input files and save the output using a userform
    By priyankaseshadri in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-22-2014, 03:14 PM
  5. Replies: 4
    Last Post: 11-28-2012, 06:09 PM
  6. [SOLVED] userform to gather input file and output folder, process reports and save
    By rufuswilson in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2012, 09:26 AM
  7. [SOLVED] VBA novice: new to userform & VB editing...
    By Dexxterr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2006, 09:10 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1