+ Reply to Thread
Results 1 to 3 of 3

next empty row

Hybrid View

  1. #1
    Registered User
    Join Date
    08-30-2010
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2008
    Posts
    7

    next empty row

    Hallo, I need help. I have my code writen but I have big problem. On my New button (on form) I can get that next entry go to next empty row. I have searched all over internet, but any solution don work for me. I am new in VBA so I please for help....Thx

    Private Sub cmdNoviUnos_Click()
    
    
    
    If UserForm1.red.Value + 1 > 35 Then
    MsgBox ("Unijeli se maskimaslni broj redova!")
    
    Else
    
    ActiveWorkbook.Save
    UserForm1.red.Value = UserForm1.red.Value + 1
    
    
    Worksheets("Izvještaj").Range("A" & UserForm1.red.Value).Select
    
    UserForm1.OdabirProjekta.Value = ""
    UserForm1.ComboBox2.Value = ""
    UserForm1.ComboBox2.Value = Sheets("Izvještaj").Range("H2").Value
    UserForm1.ComboBox3.Value = ""
    UserForm1.ComboBox4.Value = ""
    UserForm1.ComboBox5.Value = ""
    UserForm1.ComboBox6.Value = ""
    UserForm1.ComboBox7.Value = ""
    UserForm1.ComboBox7.Value = Sheets("Izvještaj").Range("D2").Value
    UserForm1.ComboBox8.Value = ""
    UserForm1.Mjesec.Value = ""
    UserForm1.Mjesec.Value = Sheets("Izvještaj").Range("E2").Value
    UserForm1.TextBox1.Value = ""
    UserForm1.TextBox2.Value = ""
    
    
    End If
    
    End Sub

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: next empty row problem - please

    Hi,

    What's your question? Are you saying that the line
    Worksheets("Izvještaj").Range("A" & UserForm1.red.Value).Select
    is not selecting the next empty row? If so how are you defining the next empty row? Is this the row immediately after the very last row which contains ANY data, or the row below the very last entry in a particular column, or perhaps the first empty row between two separate ranges of cells?

    You're probably better advised to upload your workbook or at least a representative sample of it and explain your userform inputs and what result you expect.

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-30-2010
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2008
    Posts
    7

    Re: next empty row problem - please

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    What's your question? Are you saying that the line
    Worksheets("Izvještaj").Range("A" & UserForm1.red.Value).Select
    is not selecting the next empty row? If so how are you defining the next empty row? Is this the row immediately after the very last row which contains ANY data, or the row below the very last entry in a particular column, or perhaps the first empty row between two separate ranges of cells?

    You're probably better advised to upload your workbook or at least a representative sample of it and explain your userform inputs and what result you expect.

    Rgds


    I have meant immediately after the very last row which contains ANY data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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