Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2007, 07:22 AM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Selecting all cells of an excel sheet

Hi,

I need to select all cells of an excel sheet in my Vbscript code using objSheet.getRange() method. Any idea about how can I do so? what will be the last column no. in this case?

Also, while using
objRange.HorizontalAlignment = xlLeft method, I am getting an error "Unable to set the HorizontalAlignment Property of the Range class"

Does anybody know why I am getting this error?
Any help appreciated..........

 
Old April 25th, 2007, 02:26 AM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To select all cells in an excel sheet use this piece of code

 Worksheets("<worksheet_name>").Range("A1:IV65536") .Select





Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting Cells In Flexgrid and Merging rfstuck Pro VB 6 0 April 10th, 2008 10:17 AM
merging excel cells anoopkpanicker Beginning VB 6 1 March 26th, 2007 05:11 PM
Drop Down boxes in Cells and selecting ranges tbmbob Excel VBA 0 June 1st, 2006 09:12 AM
write multi-sheet Excel w/o Excel.Application manmoth Classic ASP Components 2 November 22nd, 2005 10:56 AM
selecting records from excel androoo Pro VB 6 1 January 12th, 2005 12:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.