If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Also, you say this is a vba macro for excel, then provide two lines of code that don't mean anything but implicate you're working with access. Can you be a little more forthcoming with details?
__________________
oh yeah... documentation... I have heard of that.
Also, you say this is a vba macro for excel, then provide two lines of code that don't mean anything but implicate you're working with access. Can you be a little more forthcoming with details?
hI Teddy, peraphS solved with this code, but i want to exclude from the column ordering the field named "DATA_AGG" (attached example of mdb):
Code:
Option Explicit
Sub ORDER_FILEDS()
Dim DATABASE As DAO.DATABASE
Dim TABELLA As DAO.TableDef
Dim CAMPO_TEMP As DAO.Field
Dim POSIZIONE() As Integer
Dim CAMPO_NOME() As String
Dim INT_TEMP As Integer
Set DATABASE = OpenDatabase("C:\OPERATORI.mdb")
Set TABELLA = DATABASE.TableDefs("TEST")
With TABELLA
ReDim POSIZIONE(0 To .Fields.Count - 1) As Integer
ReDim CAMPO_NOME(0 To .Fields.Count - 1) As String
For INT_TEMP = 0 To .Fields.Count - 1
POSIZIONE(INT_TEMP) = .Fields(INT_TEMP).OrdinalPosition
CAMPO_NOME(INT_TEMP) = .Fields(INT_TEMP).Name
Next INT_TEMP
For Each CAMPO_TEMP In .Fields
CAMPO_TEMP.OrdinalPosition = 1
Next CAMPO_TEMP
End With
DATABASE.Close
End Sub