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 December 5th, 2006, 07:12 PM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Name a range simply for each third cell

If I have a row range from A4 to HQ4 and I only require every third cell from A4 then D4 then G4 ...HO4 for searching.
How do I name it with out getting typists finger?
Each third cell has a change in value the other two between are equal to the third cell.
A4=101
B4=101
c4=101
d4=102
e4=102
f4=102
g4=103
etc.
Thanks
Bill
 
Old December 6th, 2006, 04:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 173
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Bill,

In your specific example you can actually populate the row with Excel Formulae and no VBA. You need to do the following things (ignoring the double quotes - they are there to delineate what to type):
1) Type the value "101" in cell A4
2) Type the formula "=A4" into cell B4 and fill right into cell C4
3) Type the formula "=A4+1" into cell D4 and fill right into every cell over to HQ4

If what you're after is a slightly less predictable new value in every thrid cell then you might want to consider setting up a lookup table. The formula "=INT((COLUMN(A1)+2)/3)" written in a row of cells will produce a periodic incremental lookup value index which could then be used with the INDEX function on a custom table to pull through less predictable periodically changing values - i.e. Type a table of values into cells A5 to A22 and then write the following formula in Cell A4 to be filled right "=INDEX($A$5:$A$22,INT((COLUMN(A1)+2)/3))".

You can also do stuff with VBA but it sounds like this is not the most appropriate solution

Maccas

 
Old December 6th, 2006, 03:04 PM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Maccas.
Regards
Bill





Similar Threads
Thread Thread Starter Forum Replies Last Post
cell is empty while using For Each cell In Range jase2007 Excel VBA 4 April 5th, 2012 10:20 PM
simply query calculations!!!!!! thedom Access 0 March 13th, 2007 06:37 PM
Simply Deleting Question - ThnX ! ank2go SQL Language 2 November 16th, 2004 04:55 PM
Problem with a very simply code: Dango24 BOOK: Beginning ASP.NET 1.0 13 August 4th, 2004 03:50 PM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM





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