Contents - Index

DeleteLookupColumn (Macro Command)


DeleteLookupColumn 'TableName'  'ColumnName'  


Delete a specified column in an existing Lookup table that has name (showing on the tab in the window) TableName.  TableName must be a string contant (within single quotes) or a string variable containing the name of the table.  The column that is to be deleted may be indicated by providing a string constant (within single quotes) or string variable containing the name of the column in the header cell.  Alternatively, an integer may be provided that indicates the column number displayed in the upper left corner of the column header.


A range of columns may be deleted by placing the DeleteLookupColumn macro command within a Repeat..Until loop using the LookupColName$ function to determine the name of each column, as demonstrated in the following example.  Note that the column numbers change after each execution of the DeleteLookupColumn macro, so it is necessary to delete the columns from right to left.



i=10  //Delete columns 5-10 from Lookup 2

TN$='Lookup 2'



  DeleteLookupColumn TN$ C$


until (i<5)


If a column is deleted from a table that only has one column, the Lookup table will be deleted.


See also:  DeleteLookupRows