Sort Rows By Mid() String Of Column Cells

Mar 5, 2009

I have a single column dynamic range called "Dock" and I need to sort the rows in my worksheet based on information from this range.

Each cell in "Dock" is formated similarly to "TM09030010"
This is "TM" & YYMM & "4 digit number"

I need to sort my rows based first on Date "YYMM" then second by the last 4 digits of the same string.

The worksheet has information in columns A through K and Range "Dock" is located within column A.

View 9 Replies


ADVERTISEMENT

Rearrange (sort) Columns Based On Number In Column Header String

Apr 3, 2014

I want to rearrange(sort asscending) columns based on numerical value in column header string through VBA macro. Please check attachment.

i.e. (Present Data)
# A B C D
1 col.1 col.4 col.3 col.2

(Output Data )
# A B C D
1 col.1 col.2 col.3 col.4

test.bmp‎

View 2 Replies View Related

Sort Rows To Show Values Of Cells In Sequence And Eliminate Empty Cells

Nov 11, 2013

I have data on 400 rows. Each row has a maximum of 10 cells with data, but many have empty cells with no data. I would like to sort each row to show values of cells in sequence and eliminate empty cells. I can use the sort row function but its a long process for 400 individual rows. Is there an easier way?

View 1 Replies View Related

Sort On Column, But Not Include Any Rows With An X In Other Column

Jan 10, 2010

I believe that the best way to evaluate this request is to look at the example. I have 2 buttons to demonstrate what I need, along with written instructions.

eMailSampleTest.xls

View 4 Replies View Related

Excel 2010 :: Sort Rows By Column

Sep 25, 2013

I am looking for some to create a simple macro to sort multiple rows in ascending order based on the values in a particular column in the selected range. I want to sort A4:AI1004 in ascending order by column D. I recorded the following macro in Excel 2010:

VB:

Sub sort()
'
' sort Macro
' sort by column D (Sequence #)
'
'
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select

[Code]...

First of all, I think this code can probably be simplified. Secondly, it does not work in older versions of Excel. In 2007 it always ends in a runtime error. How can I clean this up so that it will work in both versions of Excel?

View 3 Replies View Related

Sort & Re-write Column Data To Rows - 2003

Nov 10, 2008

I have company asset data listed by item on wksht 1. Example:

Company A Computer 200
Company C Coffee Machine 21
Company A Car A123
Company B Computer 70
Company A Chair B14
Company B Desk C56
Company C Computer 59
Company C Desk C789

I want to sort and covert the column data on wksht1 to row data on wksht2. Example:

Company A Computer 200, Car A123, Chair B14
Company B Computer 70, Desk C56
Company C Computer 59, Coffee Machine 21, Desk C789

I'd like to do this via VBA/Macro(s) if possible.

I have to do this every month, so it would be nice to append the existing data to an "archive" file on wksht3 and then create this months data.

The data is imported each month via a text file with comma delimited fields which become the column data in the top example.

View 5 Replies View Related

Sort Rows To Remove Empty Cells?

Oct 5, 2011

Is there a way of removing empty cells from a range whilst preserving the top row? As an example, I want to change this spreadsheet...

a b c d r
rrr
rrr

[Code]....

View 3 Replies View Related

Marco To Sort Cells In Column

Jan 27, 2014

I am trying to add a macro that will sort everything by what is in column A (not the first row though) and then have it expand the selection to the entire row and sort it. so basicly it would do the same as me clicking sort and filter and then selecting sort largest to smallest and then selecting yes to expand the selection. I have found some that sort only column A but nothing that changes it all.

View 2 Replies View Related

Count Number Of Rows In A Range That Contain Less Than 5 Cells With The String VAC?

Aug 25, 2014

create a function that counts only the number of rows in a range which contain less than 5 instances of the string "VAC". So if they have less than 5 cells in the row that contain "VAC" count + 1.

View 8 Replies View Related

Delete Rows If Column Has Fewer Than X Matches To Part String Match

May 5, 2008

I have data sets on multiple worksheets within a workbook (over 70). Based on the begining of a string, I need to count all instances with that begining, and if there are fewer than 12 instances, delete the entire row.

Data set example:

In this example, I need to count each instance of rows starting with 1/* - 9/*, and delete rows as mentioned. In other data sets the string might start Gi1/*, and so on. In the following code, if I do not loop, and only test against 1 value type, and ONLY run it once, it works. As soone as I try to loop through all possibilities, or run the macro a second time, it blanks out the entire worksheet, starting at row 3.

Dim c As Long
c = Worksheets(i).Range("A" & Rows.Count).End(xlUp).Row
With Range("A3:A" & c)
If Application.WorksheetFunction.CountIf(Worksheets(i).Columns(1), "1/*") < 12 Then
. AutoFilter field:=1, Criteria1:="1/*"
.Offset(1).Resize(.Rows.Count - 1, 1).EntireRow.Delete
.AutoFilter

I have also tried to concatenate a variable with my CountIf criteria, but that fails miserably.

View 6 Replies View Related

Move And Sort With One Column But Insert Extra Columns As Needed For Proper Sort?

Jan 13, 2014

Using DataEntry sheet for data.
Trying to rearrange the data to DataFormatedProperly sheet.
So far all I can accomplish is DataFormatedWrong sheet.

Edit: Not sure what happened but file was NOT understandable before. It should be correct now.

View 2 Replies View Related

Sort / Filter Rows: Sort A Range Of Row

Nov 26, 2008

I would like to ask if it is possible to sort a range of row? What I mean is, if I sort like Row 1, the entire block of row 1 will move as well? Like if i have column A to F, then row 1 of column A to F will move together at the same time.

View 3 Replies View Related

Split Words In Comma Separated String To Cells In Column

Nov 1, 2012

I have extracted a string from my address database which goes like name,address1,address2,city,postcode,country

I need to display in Column B as:

name
address1
address2
city
postcode
country

how to do this using VBA.

View 2 Replies View Related

Extract Numbers From String (multiple Cells) And SUM Without Adding Additional Column

Apr 10, 2013

i have data stored like:

col1

XXXX1244 50
XXXX1519 60
XXXX1244 50
xxxxx1111 10
xxxxx1519 65

the last 4 caracters are numbers. I need to test these numbers and sum the corresponding values them in a single cell without adding new column(SUMIF like).

so in the above example I need to sum all ending at 1244 or 1519, therefore the sum showed in the single cell equals 225

to extract from a single cell: =VALUE(RIGHT(D8;4))

I tried to use an array formula but it seems to crash if a blank cell is in the array

View 5 Replies View Related

Sort String Array

Nov 18, 2006

I have a string (PreString) that gets its values from a procedure call (PreResult). The string consists of 4 values for each loop which I then split into the y array.

I then want to transpose the array to the worksheet for sorting.

I don't really get the transpose to work as I want to. I want every 4:th y to be printed on a new row (x). I don't really know how to use the Ubound function to get it right.

Should I make a 2 dimensional array instead ? If so, how is that made ?

Dim x As Integer, z As Integer
Dim var_Status As Integer
Dim var_Week As String
Dim var_HoursPerWeek As Integer
Dim PreString As String

i = var_StartWeekNr
j = var_RangeNumberOfWeeks
z = 0
x = 0
var_Status = 0
var_Week = ""
var_HoursPerWeek = 0
PreString = ""

View 8 Replies View Related

Remove Duplication And Sort A String

Dec 7, 2008

I'm using excel 2007 and windows vista. I have 2 cells, A1 contains (01,) and B1 contains (01, 08). I want the result in cell C1 to be (01, 08) by calling function trim_sort($A1&$B1). The code gives me an error "invalid qualifier" for s.length & more.

View 4 Replies View Related

VBA Sort String Array Function

Oct 1, 2008

I have a string that I need to sort.
Below code works beautifully but doesn't sort numbers, any advice to get this to sort numbers as well?

Function Alphabetize(ByVal sText As String) As String
Dim sWords() As String, sTemp As String
Dim i As Long, j As Long, n As Long

'-- clean up text
For i = 1 To Len(sText)
Select Case Mid$(sText, i, 1)
Case " ", "a" To "z", "A" To "Z"
Case Else: Mid$(sText, i, 1) = " "
End Select
Next
'-- remove leading and trailing spaces....................

View 9 Replies View Related

Multiple Criteria Sort (Parsed From String) Macro

Aug 18, 2014

Have a sheet with list of strings in C:C

Examples of string:

RIO AU 082814 45
RIOE AU 102815 45.01

etc...these are the two primary types

Wish to reorder row 6 onwards according to the following hierarchy:

1st order: year number ascending (ie the last 2 digits of the 6 digit mid: 14, 15 in our example)
2nd order: month number ascending (ie the first 2 digits of the 6 digit mid: 08, 10 in our example)
3rd order: strike value ascending (ie the number on far right: 45, 45.01 in our example)

sortMacro.xlsx

View 3 Replies View Related

Sort Pivot Table Based On Partial String...

Oct 6, 2008

I've got a group of data within a pivot table that I want to be sorted based on only part of the string. For example,

Standard Kitchen
Standard Master Bath
Standard Hall Bath
Optional Kitchen
Optional Basement Bath

First they would be sorted by whether they begin with Standard or Optional. Then within those groups, they would be sorted whether they contain Kitchen anywhere in the string. So that the order would be Standard Kitchens, Standard Anything Else, Optional Kitchens, Optional Anything Else.

View 3 Replies View Related

Sort Multiple Rows Without Affecting Others Rows

Aug 10, 2006

I want to sort each row in an excel sheet so all calls are in alphabetical order without affecting any other row. I need to do this for about 500 rows. Is there any quick way of doing this without having to sort each row individually.

View 3 Replies View Related

Transpose Each Row Every 5 Rows (of 15 Cells) Into One Column

Oct 19, 2013

I am using Microsoft Office Excel 2007 and Windows 7. I have a lot of data (1-4 thousands of rows) where each column represents a year for 15 years. Every set of 5 rows are different data for a company and the values for every year of each data are under the representative column.

I want to transpose the values for every year, of one data at a time, into one column. Then do the same for the next data.

For Example I have something like this:

1998
1999
2000
2001

[Code]....

If there is a way to do this for one data (i.e. data1) it will be easy to do it for the other 4. I also know how to create a macro from the Developer Tab if it is easier to create a vba code. A formula of course is ok too. I tried for hours to find a way to do this but I couldn't...

View 9 Replies View Related

Hide Rows Where 1 Column Has Zero Value Cells

May 17, 2008

I've got a macro that looks at the value of the cells in a range and if the cell value is zero, hides the correspoinding rows. It does take a bit of time to run with a 1000+ rows in the range, and I have more than one range.

Would someone mind having a look at the code and see if there is a more efficient way to run this?

Sub HideRows()

Application. ScreenUpdating = False
On Error Resume Next
With Range("EV_Amount_Range")
.EntireRow.Hidden = False

For i = 1 To .Rows.Count

If WorksheetFunction. Sum(.Rows(i)) = 0 Then
.Rows(i).EntireRow.Hidden = True
End If

Next i

End With


Application.ScreenUpdating = True
End Sub

View 9 Replies View Related

Show Rows With Matching Cells In A Column

Dec 12, 2011

I have a sheet with some survey data. the data covers about 4 months. There are about 2200 rows and 8 columns.

The "code" could be in there more than once as the person took the survey multipule times, but all other data is different. How can i pull out the whole row when the code is there more than once.

I want to know all the "codes" with multipule entries that took the survey more than once then trend there scores.

CentercodeRecommendReasonEnvironmentTraining ManagerOverall LHQTR27909415Learning effect4444LHQTR28844652
Center environment2222LHQTR45614375Service5555LHQTR96944292Service2222LHQTR144769543
Center environment4433LHQTR144769543Learning effect3433LHQTR155258791Service3213LHQTR168772563
Center environment2232LHQTR168772563Center environment3332LHQTR168772565
Learning effect4414LHQTR173991905Learning effect4445LHQTR192966385Service5555LHQTR193282534
Qualified teachers3344

View 3 Replies View Related

Keep Only Doubles Of Cells In A Column, Delete All Other Rows

Aug 21, 2009

I need a macro that keeps any row that has a cell value that shows up twice and only twice in column A. All other rows would be deleted (except the header row, row 1). For example, If it's found only once, a third time or more than three times, delete those entire rows.

This is different than "keeping only duplicates" which would be 2 OR MORE.

A couple of things,

1. The workbook might not be sorted by column A, so a cell named "ABC0011" could show up in row 3, then again in row 8, in this case, keep both.

View 9 Replies View Related

Select The Visible Cells And Count Down 50 Rows In Column

Oct 14, 2008

I would like to select the visible cells, and then count down 50 rows in column A - is this possible?

View 9 Replies View Related

Color Rows For All Cells In 1 Column Meeting Condition

Oct 26, 2007

A friend is trying to change an entire row's color based on a specific cell's value in that row. He cannot use conditional formatting. This is the code he's tried, to no avail:

Sub temp()
totalrows = ActiveSheet.UsedRange.Rows.Count
For Row = totalrows To 2 Step -1
If Cells(Row, 25).Value = 4 Then
Rows(Row).Select
Selection.Font.ColorIndex = 3
End If
Next Row
End Sub

View 2 Replies View Related

Sort Column To Match Pair In Other Column, Skip Blank Spaces

Mar 28, 2007

Here's what I have.. (on a much smaller scale)

http://www.jmetenterprises.com/produ...pics/excel.jpg

(notice how the lines that match are now even.)

[Edited by admin~ *Link* to large images, don't display them]

View 9 Replies View Related

Merge Duplicate Cells Or Keep Duplicates In One Column If One Of Rows Has Data

Apr 7, 2014

I have a huge document that looks like this

Column A______Column B_____Column C
100/12__________B___________$
100/12______________________@
100/12______________________€
250/13______________________€
250/13______________________$

I want to keep in ColumnA all three rows of 100/12, because it has a value in Column B in one cell-which is the criteria, and remove the 250/13 because it has no value in cell B.

I was assuming that merging duplicates in column A, and than remove empty from ColumnB.

View 2 Replies View Related

Copy Rows From Worksheet To Another Where Column Cells Meet Condition

Mar 31, 2008

1. I need a script to retrieve data (member number) from "Search List" worksheet and then to search it in "Members List" worksheet.

2. Once the search result (member number) found, e.g. 00311, it will copy the entire row to the "Only Selected" worksheet.

I have also attached a sample excel for better understanding.

View 9 Replies View Related

Copy Rows Where Cells In Column Match Condition/Criteria

May 5, 2008

I did a search to find a question similar to mine and I found this:
Copying data matching a criteria into another spreadsheet

This is exactly the same concept I am trying to accomplish, but don't know how to...at all. I couldn't follow the thread either.

I have a schedule which is constantly being updated (simplier version attached). I want to create a schedule, which will:
1) First ask which region to display the information for (I would like to create the same pop up menu to choose from)
2) Then, it will select only that region's information (all rows & columns) and copy them into a new worksheet and lists it all
-if you go back to the Master List, you can again choose another Region and it will create another new worksheet with that region's information
3) Don't know if this is making things more complicated, but at the bottom of the attached file, there are 3 lines under "Land".

Is it possible to list these under the same spreadsheet as the region it is pertaining to but classify it separately under "Land" (ie leaving space, so it is clear this is separate

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved