Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hide column name of query output (Office 2000)

    Hi Guys!
    I
    Attached Files Attached Files

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Hide column name of query output (Office 2000)

    Hi,
    You've basically got 3 choices that I can think of:
    1. Do the export a different way (e.g. automation and then copy the recordset into a range)
    2. Give it a different field name.
    3. When you open Excel at the end of your code, simply delete the contents of that cell.
    Without knowing why you need to do this, I can't say which is your best option.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide column name of query output (Office 2000)

    Deleting the content of that cell sounds good but can I do it automatically?
    Its always S:1
    The reason is simply because that is how my manager wants it <img src=/S/sigh.gif border=0 alt=sigh width=15 height=15>

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Hide column name of query output (Office 2000)

    Hi,
    Use something like:
    Worksheets(1).Range("S1").Clear
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide column name of query output (Office 2000)

    Rory this works but there is ONLY one problem, if there is another worksheet opened before creating this worksheet then it clears the other worksheets S1,
    My worksheet is called SFMTradeReport.

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Hide column name of query output (Office 2000)

    Try using:
    Workbooks("workbooknamehere.xls").worksheets(1).Ra nge("S1").Clear
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide column name of query output (Office 2000)

    Rory this works but there is ONLY one problem, if there is another worksheet opened before creating this worksheet then it clears the other worksheets S1,
    My worksheet is called SFMTradeReport. I tried changing 1 to SFMTradeReport but it gives me an error message.
    Worksheets("SFMTradeReport").Range("S1").Clear
    Application or object defined error
    on line AppActivate "Microsoft Excel

  8. #8
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    516
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hide column name of query output (Office 2000)

    I used this code:
    objexcel.ActiveSheet.Range("S1").Clear
    Instead of this:
    Worksheets("SFMTradeReport").Range("S1").Clear
    and it works.
    Thanx alot Rory.
    <img src=/S/bow.gif border=0 alt=bow width=15 height=15>

Posting Permissions

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