• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Selection.fillleft not working

zohaib

Member
Hello,

I record a Macro in excel and below are the results. I don't know why the code doesn't perform the steps "Selection.FillLeft". I ran the macro in debug and when it gets to Selection.FillLeft it does not do anything and keeps going down the code and starts working again from "Range("A1").Select". How do I make Selection.fillleft work?

I have also uploaded a file that contains the raw data and sheet2 shows how the final results should look. thanks

Code:
Sub Macro20()
'
' Macro20 Macro
'

'
  Cells.Select
  Cells.EntireColumn.AutoFit
  Selection.AutoFilter
  ActiveSheet.Range("$A$1:$F$400").AutoFilter Field:=2, Criteria1:= _
  "Claims Imported"
  Range("B1").Select
  Selection.End(xlDown).Select
  Selection.End(xlDown).Select
  Range(Selection, Selection.End(xlUp)).Select
  Selection.FillLeft
  Range("C1").Select
  Selection.End(xlDown).Select
  Selection.End(xlDown).Select
  Range(Selection, Selection.End(xlUp)).Select
  Selection.FillLeft
  Range("D1").Select
  Selection.End(xlDown).Select
  Selection.End(xlDown).Select
  Range(Selection, Selection.End(xlUp)).Select
  Selection.FillLeft
  Range("D1").Select
  Selection.End(xlDown).Select
  Selection.End(xlDown).Select
  Range(Selection, Selection.End(xlUp)).Select
  Range("A1").Select
  Selection.AutoFilter
  Cells.Select
  Selection.AutoFilter
  ActiveSheet.Range("$A$1:$F$400").AutoFilter Field:=1, Criteria1:=Array( _
  "AHH", "AMM", _
  "ASJ", _
  "ASL", _
  "AWB", "Charges On Multiple Forms", _
  "Claims Imported", "Claims Not Imported", "HIS Download Totals"), Operator:= _
  xlFilterValues
  Range("J49").Select
End Sub
 

Attachments

  • Book8.xlsm
    16.9 KB · Views: 1
Hi ,

Your code is not working because the FillLeft method expects a multi-column range ; given a single-column range , it will do nothing.

See the attached file for the revised code.

Narayan
 

Attachments

  • Copy of Book8.xlsm
    19.4 KB · Views: 11
Back
Top