Help needed with Macro

L

Legacy 388346

Guest
Hi Everyone, I am hoping someone can help me with my issue.
I am trying to create a macro but there is one part where I am stuck. I need to insert a column, enter in 0 and convert to number with 2 spaces.
I am having two issues. 1. if i select the whole column it will add 0.00 all the way to end of sheet instead of where the last line of data is or. if I specify a row length it could again be adding to rows with no data or not extend far enough for all the data. Thanks:)

My macro before I add the new column in front of column C is here:

Sub Spa_Upload_drop()
'
' Spa_Upload_drop Macro
'
' Keyboard Shortcut: Ctrl+d
'
Columns("H:H").Select
Columns("H:H").Cut Destination:=Columns("E:E")
Columns("G:K").Select
Selection.Delete Shift:=xlToLeft
Columns("H:P").Select
Selection.Delete Shift:=xlToLeft
Columns("A:D").Select
Range("D1").Activate
Selection.Delete Shift:=xlToLeft
Rows("1:5").Select
Range("A5").Activate
Selection.Delete Shift:=xlUp
Columns("C:C").Select
End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Once you have deleted your columns, where do you want to insert the new column?
Also is there any paricular column that will always have data on the last row?
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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