Quantcast
Viewing all articles
Browse latest Browse all 50151

Macro/VBA to Change Order of Rows/Add Rows based on specific text content presence/absence

Hello all,

I'm struggling with creating macros to do the following 2 tasks:

1. I have an existing spreadsheet of building material data. The first two columns are a Location # and Location Name. The third column over is called "System", and contains entries like "Floor, Wall, Ceiling, etc. I need to reverse the positions of the rows with System = Wall with those starting System = "Ceiling". Current the Wall rows are below the Ceiling rows, and I need the reverse to be true.

This must be simple but I'm coming up empty. I'd really appreciate some help with it.

2. This one is a bit more challenging, and I wasn't even sure where to start:

On the same spreadsheet, I need to add new rows when a Location Name/# combo exists, but doesn't have existing rows where System = Floor, Wall, Ceiling, Pipe or StructureMacro Documentation - Add-Change Rows Example.xlsm. There are 6 other columns to the Right of the System Column, and the leftmost five ideally need to be filled out with the text "N/A". An example new row entry would be (semicolons denote new column): A-01; Corridor; Floor; N/A; N/A; N/A; N/A; N/A; ; (sixth column is left blank)

Again, really appreciate any help anyone can provide on either of these challenges.

I've attached an example file with the new entries added manually :(

I'm working with Excel 2010 if that makes a difference.

Thanks,

Viewing all articles
Browse latest Browse all 50151

Trending Articles