+ Reply to Thread
Results 1 to 3 of 3

VBA Insert Column And Add Header On Multiple Sheets

  1. #1
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    VBA Insert Column And Add Header On Multiple Sheets

    Hi I wonder whether someone may be able to help me please.

    I'm trying to put together a short script which on selected sheets only, inserts a column and adds a column header to this.

    This is what I've put together so far:

    Please Login or Register  to view this content.
    The problem I have is that when I run this, I receive the following error: "Select method of range class failed" and debug highlights this line as the issue: ws.Cells.Range("D7").Select.

    I just wondered whether someone may be able to look at this and let me know where I've gone wrong.

    Many thanks and kind regards

    Chris

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London / Stockholm
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: VBA Insert Column And Add Header On Multiple Sheets

    Try this instead:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Insert Column And Add Header On Multiple Sheets

    Hi @berlan, thank you very much for taking the time to reply to my post and for setting me straight. This works great.

    All the best and kind regards

    Chris

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 12
    Last Post: 01-31-2013, 03:30 PM
  2. Replies: 6
    Last Post: 10-08-2012, 10:32 AM
  3. Replies: 2
    Last Post: 01-20-2012, 12:55 PM
  4. Insert new column on multiple sheets
    By NickWard65 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2009, 06:21 PM
  5. Replies: 2
    Last Post: 07-28-2006, 03:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1