p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

Go Back   p2p.wrox.com Forums > Microsoft Office > Excel VBA > Excel VBA
I forgot my password
Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 5th, 2006, 07:12 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old December 6th, 2006, 04:39 AM
Friend of Wrox
Points: 360, Level: 6
Points: 360, Level: 6 Points: 360, Level: 6 Points: 360, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: London, , United Kingdom.
Posts: 173
Thanks: 0
Thanked 0 Times in 0 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old December 6th, 2006, 03:04 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Maccas.
Regards
Bill
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cell is empty while using For Each cell In Range jase2007 Excel VBA 1 July 11th, 2008 05:56 PM
simply query calculations!!!!!! thedom Access 0 March 13th, 2007 07: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 04:50 PM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 10:32 AM



All times are GMT -4. The time now is 03:23 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 Wiley Publishing, Inc