Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

Remove columns from tablebox

Hi,

I've a different number of fields in tablebox when i click the button i want to remove the columns from 2nd column of table box every time. The below code is not working what i want. Can anyone help me.

sub RemoveField

         set TB = ActiveDocument.GetSheetObject("TB34")

             for i = 2 to GetColumnCount

            'msgbox i

            TB.RemoveField i

            next

end sub

1 Solution

Accepted Solutions
jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Sorry..

I got myself solution for this..Just i need to add in the above code like this...

-- >TB.RemoveField 2

sub RemoveField

         set TB = ActiveDocument.GetSheetObject("TB34")

             for i = 2 to TB.GetColumnCount

            'msgbox i

            TB.RemoveField 2

            next

end sub

View solution in original post

1 Reply
jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Sorry..

I got myself solution for this..Just i need to add in the above code like this...

-- >TB.RemoveField 2

sub RemoveField

         set TB = ActiveDocument.GetSheetObject("TB34")

             for i = 2 to TB.GetColumnCount

            'msgbox i

            TB.RemoveField 2

            next

end sub