Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 07-03-2009, 02:09 PM
slaygay slaygay is offline
Registered User
 
Join Date: 03 Jul 2009
Location: singapore
MS Office Version:Excel 2003
Posts: 2
slaygay is becoming part of the community
creating the pattern C7,C14,C21...

Please Register to Remove these Ads

Excel is able to create 'C7', 'C14', 'C21'....C(n*7)

But what i am trying to input is '=C7', '=C14, '=C21' where i am trying to copy the figures from the above mentioned cells in order to summarise my data.

What actually is happening is i created similar tables with and the information i want is 7 rows apart.

Would appreciate if someone helps me out. I cant get why excel is able to do recognise the logic for the first line but not with the '=' sign.

Please help this noobie. THanks.
Reply With Quote
  #2  
Old 07-03-2009, 03:51 PM
martindwilson's Avatar
martindwilson martindwilson is offline
Forum Guru
 
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 5,967
martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding
Re: creating the pattern C7,C14,C21...

try
=INDIRECT("C"&ROWS($A$1:A1)*7)
__________________
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code

how to enter array formula


recommended reading
wiki Mojito

how to say no convincingly

most important think you need
Reply With Quote
  #3  
Old 07-03-2009, 03:54 PM
JBeaucaire's Avatar
JBeaucaire JBeaucaire is online now
Forum Guru
 
Join Date: 21 Mar 2008
Location: Bakersfield, CA
MS Office Version:2003 (can read 2007 files)
Posts: 9,330
JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay
Send a message via Skype™ to JBeaucaire
Re: creating the pattern C7,C14,C21...

Well, INDIRECT() let's you build up a cell reference in pieces like this. Just be careful, if you put 100s and 100s of these on a sheet the sheet will start to calculate slower.

In row 1 somewhere this would work:
=INDIRECT("C" & ROW()*7)

If you start in a different row, you need to convert the first ROW() answer back to 1. So if your first formula is in row 6, it would need to be ROW()-5:
=INDIRECT("C" & (ROW()-5)*7)
__________________
If you've been given good help, use the icon in that post to give reputation feedback, it is appreciated.
Always put your code between [code] and [/code] tags.
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Reply With Quote
  #4  
Old 07-03-2009, 06:39 PM
martindwilson's Avatar
martindwilson martindwilson is offline
Forum Guru
 
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 5,967
martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding
Re: creating the pattern C7,C14,C21...

deleted duplicating my own post lol
__________________
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code

how to enter array formula


recommended reading
wiki Mojito

how to say no convincingly

most important think you need

Last edited by martindwilson; 07-03-2009 at 07:41 PM.
Reply With Quote
  #5  
Old 07-04-2009, 12:27 PM
slaygay slaygay is offline
Registered User
 
Join Date: 03 Jul 2009
Location: singapore
MS Office Version:Excel 2003
Posts: 2
slaygay is becoming part of the community
Re: creating the pattern C7,C14,C21...

thanks man!
This indirect function is something new for me which i guess should be rather useful.

Anyway, another method which i managed to come out with as a workaround is to use the c7,c14,c21 pattern and perform a find and replace from "c" to "=c" .
Reply With Quote
  #6  
Old 07-04-2009, 01:26 PM
Ancalagon12321 Ancalagon12321 is offline
Registered User
 
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
Ancalagon12321 is becoming part of the community
Re: creating the pattern C7,C14,C21...

The best method here is first of all to make sure that you have access to a macro that 'enters' the values of cells as their formulas. E.g. The following will do the trick:

Code:
Sub EnterValueAsFormula()
    Dim rng As Range: Set rng = Selection
    rng.Formula = rng.Value2
End Sub
(N.B. I never find it less than shocking that MS neglected to build this functionality into Excel directly, considering how often I use it.)

Then you can use a formula like
="=C" & COLUMN()*7,
or whatever, and then highlight the range and run your macro on it.
Reply With Quote
  #7  
Old 07-04-2009, 01:41 PM
shg's Avatar
shg shg is offline
Forum Guru
 
Join Date: 21 Jun 2007
Location: The Great State of Texas
MS Office Version:2003, 2007
Posts: 18,301
shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay
Re: creating the pattern C7,C14,C21...

Quote:
I never find it less than shocking that MS neglected to build this functionality into Excel directly
Copy > Paste Special, Values.
__________________
Entia non sunt multiplicanda sine necessitate.
Reply With Quote
  #8  
Old 07-04-2009, 02:13 PM
Ancalagon12321 Ancalagon12321 is offline
Registered User
 
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
Ancalagon12321 is becoming part of the community
Re: creating the pattern C7,C14,C21...

@shg:

Doing a paste-as-values doesn't solve this person's problem, whereas my macro does.
Reply With Quote
  #9  
Old 07-04-2009, 02:47 PM
shg's Avatar
shg shg is offline
Forum Guru
 
Join Date: 21 Jun 2007
Location: The Great State of Texas
MS Office Version:2003, 2007
Posts: 18,301
shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay
Re: creating the pattern C7,C14,C21...

Sorry, I can't tell what your procedure is intended to do. It's the same as
Code:
Sub x()
    Selection.Value2 = Selection.Value2
End Sub
... is it not?
__________________
Entia non sunt multiplicanda sine necessitate.
Reply With Quote
  #10  
Old 07-04-2009, 03:54 PM
Ancalagon12321 Ancalagon12321 is offline
Registered User
 
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
Ancalagon12321 is becoming part of the community
Re: creating the pattern C7,C14,C21...

@shg:

Yes, I think setting the Value (or Value2) property of a range has the same effect as setting its Formula property (which can actually be very annoying if you want a cell to contain the value "=whatever").

But notice, in any case, that my macro (and yours) are different from just doing a paste-as-values.
Reply With Quote
  #11  
Old 07-04-2009, 04:57 PM
shg's Avatar
shg shg is offline
Forum Guru
 
Join Date: 21 Jun 2007
Location: The Great State of Texas
MS Office Version:2003, 2007
Posts: 18,301
shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay shg makes giving solutions look like childsplay
Re: creating the pattern C7,C14,C21...

Different in what way?
__________________
Entia non sunt multiplicanda sine necessitate.
Reply With Quote
  #12  
Old 07-04-2009, 05:23 PM
Ancalagon12321 Ancalagon12321 is offline
Registered User
 
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
Ancalagon12321 is becoming part of the community
Re: creating the pattern C7,C14,C21...

@shg:

Suppose a cell contains the text string "=A1".

If you copy and overwrite using a paste-as-values then afterwards the cell still contains the text string "=A1".

On the other hand, if you use your macro then afterwards, the cell contains the formula "=A1" and its value is whatever is contained in the cell A1.
Reply With Quote
  #13  
Old 07-04-2009, 08:24 PM
JBeaucaire's Avatar
JBeaucaire JBeaucaire is online now
Forum Guru
 
Join Date: 21 Mar 2008
Location: Bakersfield, CA
MS Office Version:2003 (can read 2007 files)
Posts: 9,330
JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay JBeaucaire makes giving solutions look like childsplay
Send a message via Skype™ to JBeaucaire
Re: creating the pattern C7,C14,C21...

Quote:
Originally Posted by Ancalagon12321 View Post
@shg: But notice, in any case, that my macro (and yours) are different from just doing a paste-as-values.
Quote:
@shg: ...if you use your macro then afterwards, the cell contains the formula "=A1" and its value is whatever is contained in the cell A1.
I don't see how you reach that conclusion. Just because you're not actually using the commands copy-pastespecial-values... your macros both do that same thing. I use it all the time, and the distinction in method isn't worth debating... it is what it is.
__________________
If you've been given good help, use the icon in that post to give reputation feedback, it is appreciated.
Always put your code between [code] and [/code] tags.
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Reply With Quote
  #14  
Old 07-04-2009, 09:19 PM
martindwilson's Avatar
martindwilson martindwilson is offline
Forum Guru
 
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 5,967
martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding
Re: creating the pattern C7,C14,C21...

if i put =a1 in a cell formatted text
then copy/paste special values nothing changes!
but if i run tht macro on it it does.
__________________
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code

how to enter array formula


recommended reading
wiki Mojito

how to say no convincingly

most important think you need
Reply With Quote
  #15  
Old 07-04-2009, 09:24 PM
Ancalagon12321 Ancalagon12321 is offline
Registered User
 
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
Ancalagon12321 is becoming part of the community
Re: creating the pattern C7,C14,C21...

JBeaucaire:

Having patiently explained how the two things are different, I can only ask you to please read my post again.
Reply With Quote


Reply

Bookmarks

Tags
multiples , nseries


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump