Insert row below based on cell value

后端 未结 2 839
深忆病人
深忆病人 2021-01-23 14:07

I found a macro at Insert copied row based on cell value.

The macro inserts a blank row above any row that has a value of \"0\" in column E.

Instead of the empty

相关标签:
2条回答
  • 2021-01-23 14:31

    Edit the following line from:

    .Cells(R, Col).EntireRow.Insert Shift:=xlDown
    

    to:

    .Cells(R+1, Col).EntireRow.Insert Shift:=xlDown
    
    0 讨论(0)
  • 2021-01-23 14:55

    Pertinent to you question, modify a single line in original code: instead of:

    .Cells(R, Col).EntireRow.Insert Shift:=xlDown
    

    use this one:

    .Cells(R, Col).EntireRow.Insert Shift:=xlUp
    

    Rgds,

    0 讨论(0)
提交回复
热议问题