+ Reply to Thread
Results 1 to 2 of 2

NEXT EMPTY CELL.mi

Hybrid View

excelV3 NEXT EMPTY CELL.mi 12-04-2013, 08:39 PM
TMS Re: NEXT EMPTY CELL.mi 12-04-2013, 09:07 PM
  1. #1
    Registered User
    Join Date
    01-28-2011
    Location
    Modesto, CA
    MS-Off Ver
    Excel 2007
    Posts
    25

    NEXT EMPTY CELL.mi

    My Worksheet "ScopeOfWork " contains the table "BreakDown". The following CODE helps me to my items on my "Item No." column.
    However, it starts numbering outside my table. Can someone help me to fix it?
    Thank you.

    P.D. Sorry, I tryed to upload my project but I wasn't able too.

    Hopefully someone can help, thanks again.

    Sub ScopeOfWork()
    'Make sure Sheet "ScopeOfWork" is active.
    Sheets("ScopeOfWork").Activate
        NewItem
        ShowUserForm
        ColumnWidthSize
    End Sub
    Sub NewItem()
            If MsgBox("CREATE A NEW ITEM", vbYesNo) = vbYes Then
            Cells(Rows.Count, 1).End(xlUp).Offset(1).Value = Application.WorksheetFunction.CountA(Range("B:B")) & Chr(46)
        End If
    End Sub
    Sub ShowUserForm()
             UserForm1.Show
             Unload UserForm1
    End Sub
    Sub ColumnWidthSize()
        With Columns("A:A").Select: Selection.ColumnWidth = 4
             Columns("B:B").Select: Selection.Columns.AutoFit
             Columns("C:C").Select: Selection.Columns.AutoFit
             Columns("D:D").Select: Selection.ColumnWidth = 4
             Columns("E:E").Select: Selection.Columns.AutoFit
             Columns("F:F").Select: Selection.ColumnWidth = 20
             Columns("G:G").Select: Selection.ColumnWidth = 10
             Columns("H:H").Select: Selection.ColumnWidth = 10
             Columns("I:I").Select: Selection.ColumnWidth = 10
             Columns("J:J").Select: Selection.ColumnWidth = 10
             Columns("P:P").Select: Selection.ColumnWidth = 6
        End With
    End Sub

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,461

    Re: NEXT EMPTY CELL.mi

    When you use End(xlUp) on a sheet with a Table, it will find the bottom of the Table, not the end of the data. Unless you have blank/empty rows in your table, that should be the same thing.

    You don't need the With or End With in the ColumnWidthSize() routine.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. MACRO to empty a range of cells based on whether specified cell is empty
    By TBJV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 10:35 PM
  2. [SOLVED] still have empty cell after run Delete empty cells code
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-25-2012, 04:28 PM
  3. [SOLVED] Making reference to an empty cell display empty rather than zero
    By John007 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-12-2012, 11:13 AM
  4. Deleting empty rows if specific cell in row is empty
    By csynic in forum Excel General
    Replies: 0
    Last Post: 07-06-2011, 01:43 AM
  5. [SOLVED] 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

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