Macros delete values & shift left keeping dropdown list inplace

dnorm

Board Regular
Joined
Dec 28, 2017
Messages
125
Office Version
  1. 365
Platform
  1. Windows
HI All

I am trying to setup a FIFO (first in first out) sheet for stock. Ideally I would like to have 'CTRL+G' as the short cut to run the macro (currently set to a button).
the issue I have is keeping the dropdown list within the ranged cells. my current macro deletes everything, so formulae and dropdowns are eradicated as well.

What I am after if possible is either an auto update, or CRTL+G of macro to condense the FIFO table if the cell is empty, but keep the dropdown list (my current macro is a simple delete shift left one).


Any help would be gratefully received :)

This is my current macro:-

Sub Makro1()
'
Dim rng As Range
With ActiveSheet
With Intersect(.UsedRange, .Range("D6:W1000"))
.Value = .Value
For Each cll In .Cells
If Len(cll.Value) = 0 Then Set rng = Union(cll, IIf(rng Is Nothing, cll, rng))
Next cll
End With
End With
rng.Delete xlShiftToLeft
End Sub


Here is a sample of the destination sheet:-
FIFO 1
FIFO 2
FIFO 3
FIFO 4
FIFO 5
FIFO 6
FIFO 7
FIFO 8
FIFO 9
FIFO 10
FIFO 11
FIFO 12
FIFO 13
Part 1
CTRM53002A1
LEATHER L538 TOPPER ESPRESSO
Part 2
CTRM53003A1
LEATHER L538 TOPPER DARK CHERRY
A4
A3
A5
Part 3
CTRM53004A1
LEATHER L538 TOPPER LUNAR
Part 4
CTRM53119A1
LEATHER PRE SHRUNK EBONY
A2

<tbody>
</tbody>
 
Last edited:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,215,331
Messages
6,124,312
Members
449,152
Latest member
PressEscape

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