+ Reply to Thread
Results 1 to 3 of 3

not finding first empty row in sheet from userform

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    not finding first empty row in sheet from userform

    hi
    this code is supposed to find first empty row in sheet but it starts on row 9 and will only write to rows 9 and 10, have tried various threads and can not get any to work, have had one that writes to row 6 say then instead of next row it goes to row 12,any ideas please
      Set ws = ActiveWorkbook.Worksheets("REPAIRS")
           With Sheets("REPAIRS")
     
        
       
    ' ActiveSheet.Range("A" & Rows.Count).End(xlUp).Offset(1).EntireRow.Select
         
         NEXTROW = .Range("A" & Rows.Count).End(xlUp).Row
       ' Application.ScreenUpdating = False
            With Me
          '  ws.Range("J" & c.Row).Value = Me.TextBox7.Value
            ws.Range("A" & c.Row).Value = Me.ComboBox1.Value 'looks up repairs
        '        .TextBox1 =
           ws.Range("e" & c.Row).Value = Me.TextBox7.Value
        
            ws.Range("C" & c.Row).Value = Me.TextBox6.Value
            
           ws.Range("B" & c.Row).Value = Me.TextBox1.Value
          ws.Range("d" & c.Row).Value = Me.TextBox11.Value
          ws.Range("f" & c.Row).Value = Me.TextBox3.Value
          ws.Range("g" & c.Row).Value = Me.TextBox4.Value
         ws.Range("H" & c.Row).Value = Me.TextBox5.Value
    cheers colin
    Last edited by cfinch100; 08-02-2013 at 12:44 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: not finding first empty row in sheet from userform

    Colin

    What's c?

    Also, why aren't you using NEXTROW (+1)?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: not finding first empty row in sheet from userform

    hi norie
    tried using nextrow +1 but was not having any of it,not sure what I was doing with c.row but have found one of your old ones you gave me and works good
    Set ws = Worksheets("repairs")
        'find first row in database
        iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
        With ws
            .Range("B" & iRow) = TextBox1.Value
            .Range("h" & iRow) = TextBox5.Value
           ' .Range("F" & iRow) = txtWeekTotal.Value
            .Range("a" & iRow) = ComboBox1.Value
            .Range("d" & iRow) = TextBox11.Value
            .Range("f" & iRow) = TextBox3.Value
    cheers for answering,try to go go through all code library before putting threads on missed this one
    cheers colin

+ 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. VBA And Finding The First Empty Row
    By The Cardinal in forum Excel General
    Replies: 7
    Last Post: 01-29-2016, 06:51 PM
  2. Finding next empty Row
    By peakymatt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2009, 04:07 AM
  3. Finding next empty cell
    By MIncorporated in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-04-2006, 11:37 AM
  4. Finding next empty empty cell in a range of columns
    By UncleBun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2006, 07:25 PM
  5. finding empty selection
    By Chimanrao in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2005, 11:30 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