+ Reply to Thread
Results 1 to 2 of 2

Can anyone help me to shorten this vba code??

  1. #1
    Registered User
    Join Date
    07-28-2020
    Location
    Melbourne,Australia
    MS-Off Ver
    365
    Posts
    20

    Can anyone help me to shorten this vba code??

    One is the subroutine for adding new record from Data entry form worksheet to observation worksheet. The other subroutine is returnfoundrecord which is pasting data from observation worksheet to data entry form.

    Can anyone help me to shorten this code?

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by 6StringJazzer; 05-12-2021 at 08:41 AM. Reason: Moved from Excel General

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Can anyone help me to shorten this vba code??

    This is really a case that justifies the use of a UserForm and structured table for data storage.
    You will see in the attached example the passage of data to and from the sheet is dealt with by 6 or 7 lines of code.
    By setting out your table and its headers relative to the textboxes and their labels it is possible to loop through them to deal with naming/storing etc.
    However if you decide to stick with your on-sheet form get rid of your merged cells, they are 'bad news' when data handling.
    torachan.
    Attached Files Attached Files

+ 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. [SOLVED] Shorten VBA Code
    By richardking in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2021, 12:08 AM
  2. [SOLVED] Represent (define?) a section of code with a variable (shorten long code lines)?
    By Gene@action in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2016, 03:59 PM
  3. [SOLVED] Shorten some VBA code
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2015, 11:24 PM
  4. [SOLVED] How to Shorten my VBA Code?
    By JRidge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2014, 06:07 AM
  5. [SOLVED] Is it possible to shorten this code?
    By aaaaaaiden in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-12-2014, 11:05 AM
  6. [SOLVED] Very inefficient code because of different sizes of arrays, how do i shorten my code?
    By Brammer88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-28-2012, 04:49 PM

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