+ Reply to Thread
Results 1 to 3 of 3

Paste Userform textbox values into next empty cell on a sheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-23-2014
    Location
    Dubbo, Australia
    MS-Off Ver
    EXCEL 2019
    Posts
    180

    Paste Userform textbox values into next empty cell on a sheet

    Hi guys,

    Getting stumped at the last hurdle here. I want to copy three textbox values (RegisterID, ContactDate, BillingCode) into the next available blank row on a worksheet.
    I have worked out getting to, and selecting the first empty cell in col A on the row (example cell A9). Icannot work out how to paste RegisterID into A9, ContactDate into B9 and BillingCode into C9!
    Can someone help? Code so far:

            
            Sheets("Billing").Select
            Dim NextFree As Long
            With Sheets("Billing")
                    NextFree = Sheets("Billing").Range("A" & Rows.Count).End(xlUp).Row
                    Range("A" & NextFree).Select   '[A9] for example - works to here
                    'A9 needs to be Userform's CboPatient.Value
                    'B9 needs to be Userform's ContactDate.Value
                    'C9 needs to be Userform's PNCD.Value
            End With
    Thanks in anticipation!

    Pete
    Pete
    Struggling Solutions Architect

  2. #2
    Registered User
    Join Date
    09-15-2015
    Location
    Lodz, Poland
    MS-Off Ver
    2010
    Posts
    16

    Re: Paste Userform textbox values into next empty cell on a sheet

    Try:
    .Range("A" & NextFree).Value = UserForm1.TextBox1.Value
    .Range("B" & NextFree).Value = UserForm1.TextBox2.Value
    .Range("C" & NextFree).Value = UserForm1.TextBox3.Value
    Just rename properly UserForm1 and TextBoxes names.

  3. #3
    Forum Contributor
    Join Date
    06-23-2014
    Location
    Dubbo, Australia
    MS-Off Ver
    EXCEL 2019
    Posts
    180

    Re: Paste Userform textbox values into next empty cell on a sheet

    Thanks Wator89, that does the job!

+ 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. Paste Values empty cell, not empty
    By warston in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 12-23-2020, 08:16 PM
  2. [SOLVED] Userform to paste next empty row in current sheet
    By RaydenUK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2015, 03:46 PM
  3. [SOLVED] copy range and paste values only to another sheet in next empty row
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2015, 05:08 AM
  4. Paste values from Textbox in Sheet
    By RinorM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-30-2014, 05:13 AM
  5. search cell values from textbox value on userform
    By Templemind in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-10-2014, 09:51 PM
  6. Message Box if any of userform textbox are empty
    By Rey Ocampo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-16-2012, 02:42 PM

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