+ Reply to Thread
Results 1 to 3 of 3

Post data from UserForm to Next empty column every time...

  1. #1
    Registered User
    Join Date
    11-11-2014
    Location
    Pakistan
    MS-Off Ver
    2007
    Posts
    2

    Post data from UserForm to Next empty column every time...

    Hi, I am having a problem that...
    I have a worksheet2 with data of my Patients with following Headings,

    A B C D ("Trtmnt") E ("Date") F ("Trtmnt") G ("Date") H ("Trtmnt") G ("Date") H ("Trtmnt")
    11 S.No Name of Patient Symptoms Treatment

    I made a userform1 to add the data to this sheet2 with 4 TextBoxes and a commandButton1 to enter the data which works perfect. But I want to add the next "date" and next "treatment" of any patient to the very next empty column of selected patient's name through another UserForm2 "Add Treatment" ComboBox1.value and repeat (loop) it as many time the patient is taking his treatment and visiting each time to the clinic by entering the data by pressing the CommandButton1 of UserForm2 "Add Treatment".

    manual written on worksheet2
    A B C D ("Trtmnt") E ("Date") F ("Trtmnt") G ("Date") H ("Trtmnt") G ("Date") H ("Trtmnt")
    11 S.No Name of Patient Symtomps Medicines 01/01/2014 Medicines 02/02/2014 Medicines 03/03/2014 Medicines

    Any one can solve my problem by sending me the right vba code to add the next info of "trtmnt" of any selected patient through userform2.

    Thanks in advance for any effort for me.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Post data from UserForm to Next empty column every time...

    When you add the userform data to the sheet, store the row number you used somewhere. Any control Tag property is a good place. Using that row, you can either keep track of the column number or calculate last column using any of the functions here.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    11-11-2014
    Location
    Pakistan
    MS-Off Ver
    2007
    Posts
    2

    Re: Post data from UserForm to Next empty column every time...

    Thanks for the "TIP" I shall try it today. Hope it works fine. Thanks and Best Regards

+ 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. capture data from userform in next empty column
    By ciapul12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2013, 07:42 AM
  2. [SOLVED] userform data to cell in empty column
    By mabulco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2013, 07:17 AM
  3. [SOLVED] userform insert data on next empty row in specific column regardless of formulas
    By keiperg813 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2013, 11:46 AM
  4. [SOLVED] Userform to add data into next empty row
    By andywsw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2012, 10:10 PM
  5. Userform - always add data to next available empty row
    By D_N_L in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2012, 03:54 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