Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
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 July 1st, 2003, 10:53 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Looping thro' / Copy from Range

I'm writing a routine to loop through a range where each time it executes, a different cell in the range will have a value >0, but never more than one cell at one time.

Whichever cell in the range is >0, I want to 'copy - paste value' to the cell immediately to the left of the >0 value cell from the range.

I have the loop thro' range and copy the >0 cell code OK, but cannot resolve how to paste value to the cell to the left.

Suggestions would be greatly appreciated.

IW
 
Old July 3rd, 2003, 11:47 AM
Ben Ben is offline
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try using the offset property.

It would look something like:

ActiveCell.Offset(0, -1).Value = ActiveCell.Value

Ben





Similar Threads
Thread Thread Starter Forum Replies Last Post
Speed up code - looping and copy / paste vba_user Excel VBA 6 March 23rd, 2011 05:27 PM
Range copy Excel crash workaround TrevK Excel VBA 1 March 22nd, 2008 12:30 AM
Copy Paste Dynamic Range jgrant Excel VBA 1 February 5th, 2008 10:13 PM
Copy a worksheet range to a new workbook cej2583 Excel VBA 2 March 14th, 2006 11:55 PM





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