Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA 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 October 23rd, 2009, 03:08 AM
Registered User
 
Join Date: Oct 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default How to read Columns ?

hi,

anyone know how to code to create a new worksheet?
i only manage to read row didn't manage to read column.
i would like to read my sheet1 column5 to 7 and copy it to a new worksheet.

Last edited by waka; October 23rd, 2009 at 05:07 AM..
 
Old October 23rd, 2009, 04:42 PM
Registered User
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Maybe something like this?

Code:
    Sheets("Sheet1").Columns("E:G").Copy
    Sheets.Add
    ActiveSheet.Paste
    Application.CutCopyMode = False
The Following User Says Thank You to joe1946 For This Useful Post:
waka (October 26th, 2009)
 
Old October 26th, 2009, 02:09 AM
Registered User
 
Join Date: Oct 2009
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default

how can i make it, just to copy the value over instead of copying together with the blank space?
 
Old November 7th, 2009, 10:43 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Quote:
Originally Posted by waka View Post
how can i make it, just to copy the value over instead of copying together with the blank space?
Can you try if the following works:

Code:
Sheets("Sheet1").Columns("E:G").UsedRange.Copy
Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Read CSV file - Save Columns into Rows pintoo BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 1 August 20th, 2008 09:01 AM
two columns if... gabster XSLT 0 August 15th, 2007 12:21 PM
Read Only Form Is not Read only lryckman Access VBA 3 June 12th, 2007 06:30 AM
Java solution Read Mixed data columns from excel. pranjaldutta VBScript 1 March 19th, 2007 12:29 PM
sub columns preethisg BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 0 December 27th, 2005 01:53 AM





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