Results 1 to 9 of 9

Form Created - VBA Dropdown Doesnt Work When The Rows Are Hidden?

Threaded View

  1. #1
    Registered User
    Join Date
    09-23-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    68

    Form Created - VBA Dropdown Doesnt Work When The Rows Are Hidden?

    Hi,

    I have created a "form" where you can put information into a number of fields, hit a "Submit" button and the information stacks up as a list below this form, I use the following code and works fine -

    Sub SUBMIT()
    Dim NextRow As Long
    Application.ScreenUpdating = False
    NextRow = Sheets(1).Cells(Rows.Count, "C").End(xlUp).Row + 1
    NextRow = Sheets(1).Cells(Rows.Count, "F").End(xlUp).Row + 1
    NextRow = Sheets(1).Cells(Rows.Count, "G").End(xlUp).Row + 1
    NextRow = Sheets(1).Cells(Rows.Count, "H").End(xlUp).Row + 1
    NextRow = Sheets(1).Cells(Rows.Count, "J").End(xlUp).Row + 1
    NextRow = Sheets(1).Cells(Rows.Count, "K").End(xlUp).Row + 1
    NextRow = Sheets(1).Cells(Rows.Count, "M").End(xlUp).Row + 1
    NextRow = Sheets(1).Cells(Rows.Count, "O").End(xlUp).Row + 1
    If NextRow < 37 Then
    NextRow = 37
    End If
    Sheets(1).Cells(NextRow, "C") = Sheets(1).Range("J9:O9").Value
    Sheets(1).Cells(NextRow, "F") = Sheets(1).Range("J11:O11").Value
    Sheets(1).Cells(NextRow, "G") = Sheets(1).Range("J13:O13").Value
    Sheets(1).Cells(NextRow, "H") = Sheets(1).Range("J15:K15").Value
    Sheets(1).Cells(NextRow, "J") = Sheets(1).Range("M15").Value
    Sheets(1).Cells(NextRow, "K") = Sheets(1).Range("O15").Value
    Sheets(1).Cells(NextRow, "M") = Sheets(1).Range("J17:O17").Value
    Sheets(1).Cells(NextRow, "O") = Sheets(1).Range("C20:O26").Value
    Sheets(1).Range("J9:O9").ClearContents
    Sheets(1).Range("J11:O11").ClearContents
    Sheets(1).Range("J13:O13").ClearContents
    Sheets(1).Range("J15:K15").ClearContents
    Sheets(1).Range("M15").ClearContents
    Sheets(1).Range("O15").ClearContents
    Sheets(1).Range("J17:O17").ClearContents
    Sheets(1).Range("C20:O26").ClearContents
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    MsgBox "Submitted"
    ActiveWorkbook.Save
    End Sub
    The list it stacks into I want to hide, however when I hide the rows where the list is, the 'stacking' doesnt seem to work anymore and only puts the information into row 37 each time and overwrites itself?

    Any ideas?

    Thanks
    Last edited by npsnps; 06-02-2016 at 09:38 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] HLOOKUP doesnt work in all rows
    By Immortal2014 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-20-2015, 04:58 PM
  2. [SOLVED] Freeze columns and rows doesnt seem to work
    By colwise in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 07-21-2015, 11:15 PM
  3. Click events on buttons created at runtime only work on the last button created
    By Treacle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2010, 05:44 AM
  4. Rows(i).Hidden = True doesn't work
    By Evil Red Smurf in forum Excel General
    Replies: 3
    Last Post: 06-22-2009, 06:26 AM
  5. In Word 2007, how do I work within a form created in Word 2003
    By LilyMarie in forum Word Formatting & General
    Replies: 1
    Last Post: 03-05-2009, 04:26 AM
  6. [SOLVED] Doesn't work as it SHOULD .. Rows.Hidden /with SpecialCells
    By Gunnar Johansson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2006, 06:25 AM
  7. [SOLVED] =ROW-1, =SUBTOTAL(3,$B$2:$B2) don't work in hidden rows.
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-25-2006, 03:10 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