HI! to all
I have this macro that runs great but i want to make it work in the whole workbook besides the first 2 sheets, does any one has a quic solution for this, i will appreciate.
Thanks!
Sub Curves_Transpose_Part1()
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Dim a1 As Range, rng0
Set rng0 = Range("Q1:CE1")
For Each a1 In rng0
If a1.Offset(1, 0) > " " Then
a1.FormulaR1C1 = "=R[1]C[1]-R[1]C-1"
End If
Next a1
Dim c As Range, Rng
Set Rng = Range("Q1:CE1")
For Each c In Rng
Select Case c
Case Is = 1:
c.Offset(0, 1).EntireColumn.Insert Shift:=xlToRight
c.Offset(1, 1).FormulaR1C1 = "a"
Case Is = 2:
c.Offset(0, 1).EntireColumn.Insert Shift:=xlToRight
c.Offset(0, 1).EntireColumn.Insert Shift:=xlToRight
c.Offset(1, 1).FormulaR1C1 = "b"
c.Offset(1, 2).FormulaR1C1 = "b"
End Select
Next c
Rows("1:1").Select
Selection.Delete Shift:=xlUp
End Sub
I have this macro that runs great but i want to make it work in the whole workbook besides the first 2 sheets, does any one has a quic solution for this, i will appreciate.
Thanks!
Sub Curves_Transpose_Part1()
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Dim a1 As Range, rng0
Set rng0 = Range("Q1:CE1")
For Each a1 In rng0
If a1.Offset(1, 0) > " " Then
a1.FormulaR1C1 = "=R[1]C[1]-R[1]C-1"
End If
Next a1
Dim c As Range, Rng
Set Rng = Range("Q1:CE1")
For Each c In Rng
Select Case c
Case Is = 1:
c.Offset(0, 1).EntireColumn.Insert Shift:=xlToRight
c.Offset(1, 1).FormulaR1C1 = "a"
Case Is = 2:
c.Offset(0, 1).EntireColumn.Insert Shift:=xlToRight
c.Offset(0, 1).EntireColumn.Insert Shift:=xlToRight
c.Offset(1, 1).FormulaR1C1 = "b"
c.Offset(1, 2).FormulaR1C1 = "b"
End Select
Next c
Rows("1:1").Select
Selection.Delete Shift:=xlUp
End Sub