Beneindias
Board Regular
- Joined
- Jun 21, 2022
- Messages
- 120
- Office Version
- 365
- Platform
- Windows
- MacOS
Here I come again with my questions.
I'm trying to add a column before the last column of a table and insert the name of the column with a value that is inputed by the user.
How can I do that?
Already have code to check if already exists a column with that name in the table, if there are none, find the last column, but can't make the rest of the code.
What I have righ now:
Can anibody help me, please?
Thanks
I'm trying to add a column before the last column of a table and insert the name of the column with a value that is inputed by the user.
How can I do that?
Already have code to check if already exists a column with that name in the table, if there are none, find the last column, but can't make the rest of the code.
What I have righ now:
VBA Code:
Dim tblObrasCounter As Integer
Dim lastCol As String
tblObrasCounter = WorksheetFunction.CountIf(Worksheets("Resumo").ListObjects("ResumoKM").Range.Rows(1), MyInputObra)
If tblObrasCounter = 0 Then
With Worksheets("Resumo").ListObjects("ResumoKm")
lastCol = Worksheets("Resumo").ListObjects("ResumoKM").Range.Columns.Count
End With
End If
Can anibody help me, please?
Thanks