Create a table on a seperate sheet in the same workbook

gebo84

Board Regular
Joined
Nov 6, 2014
Messages
84
Office Version
365
Platform
Windows
Hi all,

i would like to create a table of selected information from a tracking sheet i have.

basically the tracker is a vehicle to store all requests that i get in for documents of information. i would like to create a priorty table on a seperate sheet so i can see which ones require working on first etc. To do this i created a coloumn (A) to put in a number to represent the priotriy level, 1 being the highest priortiy. In column AB i have a completion date, so dont want to include anything that is completed. Only open requests.

is there a way to pull information for everything that has a number in column A (and nothing in column AB) for these columns
A, B, F, K, O, X? then is there a way to automate the new table to have number 1's first followed by 2's etc?

Probably not explained this very well sorry!
any help is appreciated.

Thanks
George
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,914
How many priority levels do you have and what are the numbers representing each priority?
 

gebo84

Board Regular
Joined
Nov 6, 2014
Messages
84
Office Version
365
Platform
Windows
sorry for the late reply,

i will have 6 priority levels ranging from 1-6 (number 1 being the highest priotity)

thanks
George
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,914
Re-name one of your blank sheets to "Priority Table" (no quotes) and then try this macro. The macro assumes you have headers in row 1 and your data starts in row 2.
Code:
Sub CopyData()
    Application.ScreenUpdating = False
    Dim LastRow As Long, desWS As Worksheet
    Set desWS = Sheets("Priority Table")
    desWS.UsedRange.ClearContents
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    With Cells(1, 1).CurrentRegion
        .AutoFilter Field:=1, Criteria1:="<=6"
        .AutoFilter Field:=28, Criteria1:="<>"
        Intersect(.Rows("1:" & LastRow).SpecialCells(xlCellTypeVisible), .Range("A:A,B:B,F:F,K:K,O:O,X:X")).Copy desWS.Cells(1, 1)
    End With
    Range("A1").AutoFilter
    LastRow = desWS.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    desWS.Sort.SortFields.Clear
    desWS.Sort.SortFields.Add Key:=Range("A2:A" & LastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With desWS.Sort
        .SetRange Range("A1:F" & LastRow)
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    Application.ScreenUpdating = True
End Sub
 
Last edited:

gebo84

Board Regular
Joined
Nov 6, 2014
Messages
84
Office Version
365
Platform
Windows
Thanks for that, it didnt work though.....

Run time error "91" Object variable or block not set
when i click on debug it highlights the line which begins with "lastRow" ??
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,914
When I tested the macro on some dummy data, it worked properly. I think that it would be easier to help and test possible solutions if I could work with your actual file which includes any macros you are currently using. Perhaps you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,914
I'm having trouble downloading your file. How big is your file? I'm not sure if there is a problem with DropBox or the file is extremely large.
 

gebo84

Board Regular
Joined
Nov 6, 2014
Messages
84
Office Version
365
Platform
Windows
it says 1.26mb so not that big....
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,914
I've tried to download the file several times. Even at 1.26 mb it shouldn't take too long to download. However, DropBox displays the file but then seems to just freeze up. Could I suggest you try to upload it to Box.com instead?
 

Watch MrExcel Video

Forum statistics

Threads
1,096,415
Messages
5,450,284
Members
405,602
Latest member
Zeds123

This Week's Hot Topics

Top