+ Reply to Thread
Results 1 to 3 of 3

VBA problem selecting column

  1. #1
    Registered User
    Join Date
    05-06-2005
    Posts
    4

    VBA problem selecting column

    I have the following macro:

    Columns("A:A").Select
    Selection.Delete Shift:=xlToLeft
    Rows("1:10").Select
    Selection.Delete Shift:=xlUp
    Range("G1").Select
    Columns("B:B").Select
    Selection.ColumnWidth = 11.86

    This works until the second last line where I want to select column B. It is
    actually selecting columns A-R. At that point columns A-S exist so it's not
    selecting all columns with data. I added the range line above that so that it
    would deselect rows 1 - 10.

    I've tried deleting my macro and starting over and also deleting the worksheet
    to no avail.

    Any help is appreciated.

  2. #2
    Registered User
    Join Date
    08-20-2003
    Location
    Luton, England
    Posts
    63
    I am using xl97 and your code worked ok.

    This is a better version :-
    Please Login or Register  to view this content.
    Regards
    BrianB
    Most problems are caused by starting from the wrong place.
    Use a cup of coffee to speed up all Windows processes.
    It's easy until you know how.
    -----------------------------------------

  3. #3
    Registered User
    Join Date
    05-06-2005
    Posts
    4
    Thanks Brian, your suggested method resolved my problem!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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