Announcement

Collapse
No announcement yet.

Move Cell Values to the Right (Macro)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Move Cell Values to the Right (Macro)



    looking for a macro that will do the following (see attachment):

    If column d (Subscription) = "quarterly" and column H (product_component_name) = "Min" then shift cell values by 3 to the right within the Column Range (M to AJ)
    Attached Files

  • #2
    Code:
    Sub Maybe()
    Dim c As Range
        For Each c In Range("D2:D" & Cells(Rows.Count, 4).End(xlUp).Row)
            If Trim(c.Value) = "Quarterly" And Trim(c.Offset(, 4).Value) = "Min" Then c.Offset(, 9).Resize(, 4).Insert Shift:=xlToRight
        Next c
    End Sub
    You have a leading space in Column D, that's why the use of Trim

    Comment


    • #3
      Thank you! Would you know how to do this in Power BI?

      Comment


      • #4
        If that satisfies your needs, thanks for letting us know.

        Comment


        • #5


          What is Power BI?

          Comment

          Working...
          X