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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,304
Office Version
  1. 365
Platform
  1. Windows
Could you explain the logic?
 

kevinsky

New Member
Joined
Apr 7, 2004
Messages
8
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.
 

Forum statistics

Threads
1,141,756
Messages
5,708,332
Members
421,565
Latest member
Lastadiego

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
Top