Hi,
I'm writing a macro that lets the user select a file with product codes that need to be correctly formatted. Then the user can select the worksheet in the selected workbook. The workbook is opened, and I want to add a column. The code then runs through the opened file and compares to a worksheet in the file that the macro is saved in to get the correct format. The correctly formatted code will go into a new column.
My code to insert a column is bugging and I don't understand why. Thanks for your help!
Here is the code that I think is pertinent:
...
Set objFSO = CreateObject("scripting.filesystemobject")
fichEtRep = Application.GetOpenFilename(fileFilter:="XLS Files (*.xls),*.xls", Title:="Sélection le fichier avec les codes articles à formatter", Buttontext:="OK")
fichAOuvrir.Text = fichEtRep
...
...
Workbooks(fichAOuvrir).Worksheets(cboWorksheets.Value).Range(A).EntireColumn.Insert
I'm writing a macro that lets the user select a file with product codes that need to be correctly formatted. Then the user can select the worksheet in the selected workbook. The workbook is opened, and I want to add a column. The code then runs through the opened file and compares to a worksheet in the file that the macro is saved in to get the correct format. The correctly formatted code will go into a new column.
My code to insert a column is bugging and I don't understand why. Thanks for your help!
Here is the code that I think is pertinent:
...
Set objFSO = CreateObject("scripting.filesystemobject")
fichEtRep = Application.GetOpenFilename(fileFilter:="XLS Files (*.xls),*.xls", Title:="Sélection le fichier avec les codes articles à formatter", Buttontext:="OK")
fichAOuvrir.Text = fichEtRep
...
...
Workbooks(fichAOuvrir).Worksheets(cboWorksheets.Value).Range(A).EntireColumn.Insert