PDA

View Full Version : move items in column up/down by criteria



Loss1003
06-04-2009, 10:07 AM
Need help in writing a vba code for a macro button to move cell(s) in the following range D2:E151 one cell below based on the below criteria.

Criteria: If value in H2 >3

the cells in D2: D151 are Producer Act Names
The cells in E2:E151 are Producer Act ID'S

Thanks,

mdmackillop
06-04-2009, 10:36 AM
Can you post a workbook showing Before and After? Use Manage Attachments in the Go Advanced reply section.

Loss1003
06-04-2009, 11:05 AM
I've attached a sample worksheet.

Thanks,

mdmackillop
06-04-2009, 11:26 AM
What happens to values 5, 6, 7 etc.? Do the 4 need to be together? What happens if not? Anything else to consider?

Loss1003
06-04-2009, 12:43 PM
The Four do not need to be together.

If any further matching records appear in the list they will also need to be shifted down one cell.

If the they are not together the same applies if the criteria is > 3 the cell needs to be shifted down one cell.

Hope this helps.

mdmackillop
06-04-2009, 02:32 PM
Try this