VBA Code to Move Data up in A Column so there is no blank cells in between

mrsushi

Board Regular
Joined
Nov 18, 2006
Messages
180
Office Version
  1. 2010
Can you help me change this VBA code so that only the SEDOL data in column A is moved up (so its nice and tidy)?

The below method deletes the entire row which is fine to some extent, but it messes up the row numbers , ie if you delete row 3+4+5…..the order of the rows be 1,2,6 etc. this will impact the ability to copy and paste special colum n J

Instead can you advise the code how to move the next available Sedol to move up ie row 19 to row 4, etc



Sub SecurityFormatremove()
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:A" & lastrow).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
 

Attachments

  • SAMPLE.JPG
    SAMPLE.JPG
    196.7 KB · Views: 97

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
How about
VBA Code:
Range("A:A").SpecialCells(xlBlanks).Delete xlUp
 
Upvote 0
Glad to here that & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

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