How to shift cells left by VBA?

NewLFC

New Member
Joined
May 5, 2022
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
I have the report in which I want to delete some cells to the left as shown in the excel file


Original reportExpected result
Ordered byownerOrder numberOrdered byownerOrder number
Units Under Status "O"Units Under Status "O"
8​
Units at Bonded Ware House
8​
Units at Bonded Ware House
1​
THANI-COOCTLAQW227501MR0BA3CD700151747229330
1​
THANI-COOCTLAQW227501MR0BA3CD700151747229330
2​
THANI-COOCTLAQW47120MR0BA3FS50112850548416
2​
THANI-COOCTLAQW47120MR0BA3FS50112850548416
3​
THANI-COOCTLAQW116289MR0KB8CD501214980118510
3​
THANI-COOCTLAQW116289MR0KB8CD501214980118510
4​
THANI-COOCTLAQW795069MR2B13F3901071113798709
4​
THANI-COOCTLAQW795069MR2B13F3901071113798709
5​
THANI-COOCTLAQW244859JTMAA7BJ104018824248221
5​
THANI-COOCTLAQW244859JTMAA7BJ104018824248221
6​
THANI-COOCTLAQW509980JTMAA7BJX04018028513496
6​
THANI-COOCTLAQW509980JTMAA7BJX04018028513496
7​
THANI-COOCTLAQW676088MR0KB8CD201215326679710
7​
THANI-COOCTLAQW676088MR0KB8CD201215326679710
8​
THANI-COOCTLAQW385310MR0KB8CD101215494387482
8​
THANI-COOCTLAQW385310MR0KB8CD101215494387482
11​
Units at BSD
11​
Units at BSD
1​
THANI-COOCTLAQW200130MR0BA3CD700151747202383
1​
THANI-COOCTLAQW200130MR0BA3CD700151747202383
2​
THANI-COOCTLAQW715841MR0BA3FS501128505717328
2​
THANI-COOCTLAQW715841MR0BA3FS501128505717328
3​
THANI-COOCTLAQW515069MR0KB8CD501214980517558
3​
THANI-COOCTLAQW515069MR0KB8CD501214980517558
4​
THANI-COOCTLAQW609158MR2B13F3901071113611401
4​
THANI-COOCTLAQW609158MR2B13F3901071113611401
5​
THANI-COOCTLAQW512040JTMAA7BJ104018824514155
5​
THANI-COOCTLAQW512040JTMAA7BJ104018824514155
6​
THANI-COOCTLAQW163305JTMAA7BJX04018028166650
6​
THANI-COOCTLAQW163305JTMAA7BJX04018028166650
7​
THANI-COOCTLAQW719652MR0KB8CD201215326721564
7​
THANI-COOCTLAQW719652MR0KB8CD201215326721564
8​
THANI-COOCTLAQW511616MR0KB8CD101215494513687
8​
THANI-COOCTLAQW511616MR0KB8CD101215494513687
9​
THANI-COOCTLAQW513390MR0KB8CD701215516515016
9​
THANI-COOCTLAQW513390MR0KB8CD701215516515016
10​
THANI-COOCTLAQW681865MR0KB8CD801215427685204
10​
THANI-COOCTLAQW681865MR0KB8CD801215427685204
11​
THANI-COOCTLAQW92113MR0KB8CD80121545893914
11​
THANI-COOCTLAQW92113MR0KB8CD80121545893914
Units on Status "A"Units on Status "A"
3​
Units at The ATN
3​
Units at The ATN
1​
THANI-COOCTLAQW553416MR0BA3CD800155130556385
1​
THANI-COOCTLAQW553416MR0BA3CD800155130556385
2​
THANI-COOCTLAQW667209MHKAA1BA00J044402670823
2​
THANI-COOCTLAQW667209MHKAA1BA00J044402670823
3​
THANI-COOCTLAQW271658MR2KZAAG300043353274138
3​
THANI-COOCTLAQW271658MR2KZAAG300043353274138
10​
Units at SYSRT
10​
Units at SYSRT
1​
THANI-COOCTLAQW560946MHKAA1BA00J040107563624
1​
THANI-COOCTLAQW560946MHKAA1BA00J040107563624
2​
THANI-COOCTLAQW757296MR0BA3CD000156563759217
2​
THANI-COOCTLAQW757296MR0BA3CD000156563759217
3​
THANI-COOCTLAQW768534MR0BA3CD500156574769786
3​
THANI-COOCTLAQW768534MR0BA3CD500156574769786
4​
THANI-COOCTLAQW616166MR0JB8CD502155113619348
4​
THANI-COOCTLAQW616166MR0JB8CD502155113619348
5​
THANI-COOCTLAQW774677MR2KZAAG800041775776637
5​
THANI-COOCTLAQW774677MR2KZAAG800041775776637
6​
THANI-COOCTLAQW340450JTMAA7BJ704020030343661
6​
THANI-COOCTLAQW340450JTMAA7BJ704020030343661
7​
THANI-COOCTLAQW474652MHKAA1BAX0J044293476614
7​
THANI-COOCTLAQW474652MHKAA1BAX0J044293476614
8​
THANI-COOCTLAQW357787MHKE8FF3V0K019126360179
8​
THANI-COOCTLAQW357787MHKE8FF3V0K019126360179
9​
THANI-COOCTLAQW224744MHKE8FF3V0K019147227298
9​
THANI-COOCTLAQW224744MHKE8FF3V0K019147227298
10​
THANI-COOCTLAQW302895MR0BA3CD100158354306842
10​
THANI-COOCTLAQW302895MR0BA3CD100158354306842
 

Attachments

  • Capture.JPG
    Capture.JPG
    239.1 KB · Views: 9

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Try this :
VBA Code:
Sub v()
Dim a As Range
For Each a In [B:B].SpecialCells(xlCellTypeConstants, 1).Offset(0, -1).Areas
    a.Delete Shift:=xlToLeft
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,299
Messages
6,177,754
Members
452,798
Latest member
mlance617

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