Results 1 to 4 of 4

add data from userform without opening the targetsheet

Threaded View

  1. #1
    Registered User
    Join Date
    07-02-2018
    Location
    australia
    MS-Off Ver
    2016
    Posts
    60

    add data from userform without opening the targetsheet

    Good afternoon all

    Hope all had or is having a happy new year

    I'm trying to add data from a user form to a specific sheet
    I can do this but i don't want to see the target sheet
    i want to remain on the current sheet

    Private Sub CommandButton1_Click()
    TargetSheet = ComboBox1.Value
    If TargetSheet = "" Then
    Exit Sub
    End If
    Worksheets(TargetSheet).Activate
    lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    ActiveSheet.Cells(lastrow + 1, 1).Value = TextBox1.Value
    MsgBox ("DATA ADDED SUCCESSFULLY")
    Unload Me
    End Sub
    
    Private Sub UserForm_Initialize()
    With ComboBox1
    .AddItem "NAMES"
    .AddItem "JOBS"
    .AddItem "PROCESSES"
    .AddItem "FORMS"
    End With
    End Sub
    Last edited by danny25; 01-01-2022 at 03:49 AM. Reason: solved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] When opening more than one excel file, the userform does not read the data from the main
    By saftawy1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-31-2021, 01:10 PM
  2. Replies: 0
    Last Post: 03-03-2021, 06:02 PM
  3. Populate Listbox1 with data from a named range when opening userform
    By mhamm26 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-04-2017, 09:40 AM
  4. Place picture in a targetsheet in one row
    By WilVerstappen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2016, 03:55 PM
  5. Place picture on targetsheet
    By WilVerstappen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2016, 04:01 AM
  6. [SOLVED] Code error opening userform for data entry
    By dwheggen1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2015, 02:14 PM
  7. [SOLVED] userform opening on sheet2 but not showing combobox data values
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2014, 08:29 AM

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