+ Reply to Thread
Results 1 to 3 of 3

Transfer Userform data on 1 worksheet to different worksheet (empty row = wrong sheet)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Transfer Userform data on 1 worksheet to different worksheet (empty row = wrong sheet)

    My UserForm is on sheet1 ("Dashboard") - but when the command button is clicked, I want the values to go the next empty row on the 3rd worksheet ("Data"), which is hidden.

    The code I have works half way - it will transfer to the correct sheet, but it's reading the next empty row from the first sheet, the Dashboard, not from the Data worksheet.

    Private Sub SaveClose_Click()
    Dim ws1 As Worksheet:   Set ws1 = Sheets("Dashboard")
    Dim ws3 As Worksheet:   Set ws3 = Sheets("Data")
    
    Dim emptyRow As Long
    
    emptyRow = WorksheetFunction.CountA(Range("$C:$C")) + 1
    
    ws3.Cells(emptyRow, 3).Value = cboSupName.Value
    
    End Sub
    Thanks!!

    -HeyInKy

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

    Re: Transfer Userform data on 1 worksheet to different worksheet (empty row = wrong sheet)

    Private Sub SaveClose_Click()
    Dim ws1 As Worksheet:   Set ws1 = Sheets("Dashboard")
    Dim ws3 As Worksheet:   Set ws3 = Sheets("Data")
    
    Dim emptyRow As Long
    With ws3
    emptyRow = WorksheetFunction.CountA(ws3.Range("$C:$C")) + 1
    .Cells(emptyRow, 3).Value =  cboSupName.Value
    End With
    
    End Sub

  3. #3
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: Transfer Userform data on 1 worksheet to different worksheet (empty row = wrong sheet)

    Perfect! Thanks you.

+ 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] Userform transfer data into worksheet
    By kheytli in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2013, 01:09 PM
  2. Replies: 1
    Last Post: 06-30-2012, 01:11 PM
  3. Replies: 20
    Last Post: 05-24-2012, 10:51 AM
  4. Transfer Data From Userform to Worksheet
    By ScotyB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2012, 07:12 AM
  5. Transfer Userform Data to next empty Row
    By Mrs. Robinson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2010, 04:24 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