Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9125689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:51:41+00:00 2026-06-17T06:51:41+00:00

The scenario is a table is received each week in Word 2010 that needs

  • 0

The scenario is a table is received each week in Word 2010 that needs adjustments. Among other additions to the macro, the column named “WebSite” needs to be deleted. The column called “WebSite” might not always be in the same position though.

I need to know the VBA code for finding, selecting and deleting a specific table column that can potentially change positions, but will always keep the same column title.

Is there a way to insert a search word in the vba code that will ensure the right column is deleted even if its position in the table can change each time a table is opened in Word?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:51:42+00:00Added an answer on June 17, 2026 at 6:51 am

    Try:

    Dim tbl As Table
    Dim cl As Cell
    
    ''All tables
    For Each tbl In ActiveDocument.Tables
        ''Look in row 1 only ...
        For Each cl In tbl.Rows(1).Cells
            ''For a cell containing website and end of cell
            If cl.Range.Text = "website" & Chr(13) & Chr(7) Then
                ''Select ...
                cl.Column.Select
                ''Allow the user to choose delete
                If MsgBox("Del selected?", vbYesNo) = vbYes Then
                    cl.Column.Delete
                End If
            End If
        Next
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: Table A MasterID, Added Date, Added By, Updated Date, Updated By, 1, 1/1/2010,
I have a scenario outline table that looks like the following: Scenario Outline: Verify
Scenario: I have a list table being populated from a combobox. That list table
The Scenario I have a table on a web page that is dynamically generated
Database software: SQLITE Consider this scenario: Table X has attributes: A,B,C,D,1,2,3,4 Table Y needs
I have a table that stores customer items. The table needs to reflect the
Scenario 1 I have one table lets say member. In that table member i
I have the following scenario: a table that is accessed (update, delete, insert and
I have the following scenario: a table of projects and a table of persons,
Scenario: WAMP server, InnoDB Table, auto-increment Unique ID field [ INT(10) ], 100+ concurrent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.