mismatched entries

kevinsky

New Member
Joined
Apr 7, 2004
Messages
8
I have a spreadsheet that needs cleaning up.

Before
Text 20060469 20060470 name name many more columns
Text 20060470 20060471 name name
Text 20060470 20060472 name name
Text 20060471 20060473 name name

After
Text 20060469 blank columns
Text 20060470 20060470 name name many more columns
Text 20060470 blank columns
Text 20060471 20060471 name name
Text 20060472 20060472 name name
Text 20060473 20060473 name name

I feel so silly not being able to code it when I can write it out
for all rows from 1 to 1000
If B432 != C432 THEN
move active selection down a row
insert a row
cut the range from C432 to AA432
paste it in the newly inserted row at C433 to AA433
delete the empty cell at A433 to B433
and move contents up
end if
end loop

The macro should look something like

Selection.EntireRow.Insert
Range("D401:AR401").Select
'the range selection should refer to the active selection
Selection.Cut
Range("D402").Select
ActiveSheet.Paste
Range("A402:C402").Select
Range("C402").Activate
Selection.Delete Shift:=xlUp

what is the syntax to select the active selection dynamically?

Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Could you explain the logic?
 
Upvote 0
Sorry, the client has realized they didnt ask a good question in the first place which is what caused this.
Back to the drawing board!

Thank you for responding, we can close this.
 
Upvote 0

Forum statistics

Threads
1,215,646
Messages
6,126,004
Members
449,279
Latest member
Faraz5023

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top