+ Reply to Thread
Results 1 to 4 of 4

Selecting entire column.

  1. #1
    Registered User
    Join Date
    10-07-2004
    Posts
    7

    Selecting entire column.

    What is the code to selecting entire column for a VBA Macro?

    A:A??

    "=SUM(Sheet1!A:A)"

    Thanks

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello bawahoo,

    You can use any of the following:

    Selecting a Single Column
    Range("A:A").Select 'Selects all of Column "A"
    Range("A10").EntireColumn.Select 'Selects all of Column "A"
    Cells(1,3).EntireColumn.Select 'Selects all of Column 3 or "C"


    Multiple Columns
    Range("A5:B10").EntireColumn.Select 'Selects all of Column "A" and all of "B"

    Hope this guide helps,
    Leith Ross
    Last edited by Leith Ross; 04-14-2005 at 07:00 PM.

  3. #3
    Registered User
    Join Date
    10-07-2004
    Posts
    7
    Thanks for your reply.

    How would I add this into the macro...like this???

    Sheet2
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "ACCT NO TOTAL"
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "=COUNT(Sheet1!D:D)"

    Where D contains Acct No in Sheet1. I would to count the num of accts.

    ???????
    Last edited by bawahoo; 04-14-2005 at 07:08 PM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello bawahoo,

    Looks fine. Give it a try. If you have problems, post them and I'll help figure it out.

    Sincerely,
    Leith Ross

+ 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