Hi All - I just have a few issues on my VBA i'm creating for some macros. At the bottom I do have some of the code i've done for each part, and if they are successful yet or not.
I am using an in-house data unpivot Excel tool that requires tagging around your data and I am trying to format an OTP export automatically to get it ready for it.
I am happy to provide more context and even a dummied out sample of the file if needed. Thank you all so much!!!
---------------------------------------------------------------------------------------------------------
Part 1 - I need to add "#COL[C]" in the soonest row in column B
Part 2 - I need to add "#COL[A]" in the top row of the first column that doesn't contain header data
Part 3 - I need to add "#COL" in the cell right under "#COL[A]"
Part 4 - I need to add "#ROW" in every cell under "#COL" and will stop based on the last populated row in column B
Part 5 - I last need to add "#ROW" to the right of the populated "#COL[C]" from column B into each column on that same row, up until the last column BEFORE the column with #COL[A] and #COL, etc...technically it would stop at the second to last column.
---------------------------------------------------------------------------------------------------------
Part 1 - GOOD
Sub ColC()
Dim N As Long
N = Cells(Rows.Count, "B").End(xlUp).Row + 1
Cells(N, "B").Value = "#COL[C]"
End Sub
----------------------------------------------------------------------------------------------------------
Part 2 - GOOD
Sub ColA()
Dim N As Long
N = Cells(1, Columns.Count).End(xlToLeft).Column + 1
Cells(N) = "#COL[A]"
End Sub
---------------------------------------------------------------------------------------------------------
Part 3 - BAD
Sub ColB()
Dim N As Long
N = Cells(2, Columns.Count).End(xlToLeft).Column + 1
Cells(N) = "#COL"
End Sub
---------------------------------------------------------------------------------------------------------
Part 4 - Don't know how to do it
---------------------------------------------------------------------------------------------------------
Part 5 - Don't know how to do it
I am using an in-house data unpivot Excel tool that requires tagging around your data and I am trying to format an OTP export automatically to get it ready for it.
I am happy to provide more context and even a dummied out sample of the file if needed. Thank you all so much!!!
---------------------------------------------------------------------------------------------------------
Part 1 - I need to add "#COL[C]" in the soonest row in column B
Part 2 - I need to add "#COL[A]" in the top row of the first column that doesn't contain header data
Part 3 - I need to add "#COL" in the cell right under "#COL[A]"
Part 4 - I need to add "#ROW" in every cell under "#COL" and will stop based on the last populated row in column B
Part 5 - I last need to add "#ROW" to the right of the populated "#COL[C]" from column B into each column on that same row, up until the last column BEFORE the column with #COL[A] and #COL, etc...technically it would stop at the second to last column.
---------------------------------------------------------------------------------------------------------
Part 1 - GOOD
Sub ColC()
Dim N As Long
N = Cells(Rows.Count, "B").End(xlUp).Row + 1
Cells(N, "B").Value = "#COL[C]"
End Sub
----------------------------------------------------------------------------------------------------------
Part 2 - GOOD
Sub ColA()
Dim N As Long
N = Cells(1, Columns.Count).End(xlToLeft).Column + 1
Cells(N) = "#COL[A]"
End Sub
---------------------------------------------------------------------------------------------------------
Part 3 - BAD
Sub ColB()
Dim N As Long
N = Cells(2, Columns.Count).End(xlToLeft).Column + 1
Cells(N) = "#COL"
End Sub
---------------------------------------------------------------------------------------------------------
Part 4 - Don't know how to do it
---------------------------------------------------------------------------------------------------------
Part 5 - Don't know how to do it