Flash Fill vs Fill Down, Fill Right, Fill Left, Fill Up Excel example

Flash Fill vs Fill Down, Fill Right, Fill Left, Fill Up Excel example

FlashFill vs FillDown

Determines a pattern in the selection and fill the remaining cells in a Range. FlashFill is a method which is exposed by range object in Excel. CTRL + E is the shortcut key to apply Flash Fill. FillDown copies cells from top to bottom including formatting, formula and text. CTRL + D is the shortcut key to apply Fill Down in a range.

Flash Fill

  1. Select Range to apply Flash Fill
  2. Navigate to Data Tab
  3. Click on Flash Fill button under Data Tools group on the ribbon

Example

Consider below data source where I have data and would like to extract all four digits number from my string. To do so, I have extracted two values to let the Excel recognize the pattern. Keep selection in B3 cell and follow above steps to apply Flash Fill or press CTRL + E.

VBA code example

Public Sub FlashFillExample()
    'declare object to hold Range
    Dim oRange As Range
    
    'Bind selection
    Set oRange = Selection
    
    'Perform flasfill
    oRange.FlashFill
    
    'Memory cleanup
    Set oRange = Nothing
End Sub

Output

Fill Down

Select the range which you want to fill including cell that you would like to copy. Consider below screenshot where I have placed a formula in Column “A1” which joins value from Column “B“. You need to make selection from column “A2” to “A14” or upto row you want to fill down same formula in Column “A” and press CTRL + D.

VBA code example

Public Sub FillDownExample()
    'declare object to hold Range
    Dim oRange As Range
    
    'Bind selection
    Set oRange = Selection
    
    'Perform fill down
    oRange.FillDown
    
    'Memory cleanup
    Set oRange = Nothing
End Sub

Output

Fill Right

Extend selection in the right direction including cell whose content you wish to fill right side and press CTRL + R key.

VBA code example

Public Sub FillRightExample()
    'declare object to hold Range
    Dim oRange As Range
    
    'Bind selection
    Set oRange = Selection
    
    'Perform Right Fill
    oRange.FillRight
    
    'Memory cleanup
    Set oRange = Nothing
End Sub

Output

Fill Left

Extend selection to the left side including cell whose contents you wish to fill left from as shown below:

VBA code example

Public Sub FillLeftExample()
    'declare object to hold Range
    Dim oRange As Range
    
    'Bind selection
    Set oRange = Selection
    
    'Perform Left Fill
    oRange.FillLeft
    
    'Memory cleanup
    Set oRange = Nothing
End Sub

Output

Fill Up

Select the cell from which you want to copy contents and extend selection to the upper cells upto you want as shwon below:

VBA code example

Public Sub FillUpExample()
    'declare object to hold Range
    Dim oRange As Range
    
    'Bind selection
    Set oRange = Selection
    
    'Perform Fill Up
    oRange.FillUp
    
    'Memory cleanup
    Set oRange = Nothing
End Sub

Output

Please leave your comments or queries under comment section also please do subscribe to our blogs to keep your self upto date.

Leave a Reply

Your email address will not be published.