Forum Statistics
- Forum Members:
- Total Threads:
- Total Posts: 16
There are 1 users currently browsing forums.
|
 |
|

07-03-2009, 02:09 PM
|
|
Registered User
|
|
Join Date: 03 Jul 2009
Location: singapore
MS Office Version:Excel 2003
Posts: 2
|
|
|
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.
|

07-03-2009, 03:51 PM
|
 |
Forum Guru
|
|
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 5,967
|
|
|
Re: creating the pattern C7,C14,C21...
try
=INDIRECT("C"&ROWS($A$1:A1)*7)
|

07-03-2009, 03:54 PM
|
 |
Forum Guru
|
|
Join Date: 21 Mar 2008
Location: Bakersfield, CA
MS Office Version:2003 (can read 2007 files)
Posts: 9,330
|
|
|
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!)
|

07-03-2009, 06:39 PM
|
 |
Forum Guru
|
|
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 5,967
|
|
|
Re: creating the pattern C7,C14,C21...
deleted duplicating my own post lol
Last edited by martindwilson; 07-03-2009 at 07:41 PM.
|

07-04-2009, 12:27 PM
|
|
Registered User
|
|
Join Date: 03 Jul 2009
Location: singapore
MS Office Version:Excel 2003
Posts: 2
|
|
|
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" .
|

07-04-2009, 01:26 PM
|
|
Registered User
|
|
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
|
|
|
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.
|

07-04-2009, 01:41 PM
|
 |
Forum Guru
|
|
Join Date: 21 Jun 2007
Location: The Great State of Texas
MS Office Version:2003, 2007
Posts: 18,301
|
|
|
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.
|

07-04-2009, 02:13 PM
|
|
Registered User
|
|
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
|
|
|
Re: creating the pattern C7,C14,C21...
@shg:
Doing a paste-as-values doesn't solve this person's problem, whereas my macro does.
|

07-04-2009, 02:47 PM
|
 |
Forum Guru
|
|
Join Date: 21 Jun 2007
Location: The Great State of Texas
MS Office Version:2003, 2007
Posts: 18,301
|
|
|
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.
|

07-04-2009, 03:54 PM
|
|
Registered User
|
|
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
|
|
|
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.
|

07-04-2009, 04:57 PM
|
 |
Forum Guru
|
|
Join Date: 21 Jun 2007
Location: The Great State of Texas
MS Office Version:2003, 2007
Posts: 18,301
|
|
|
Re: creating the pattern C7,C14,C21...
Different in what way?
__________________
Entia non sunt multiplicanda sine necessitate.
|

07-04-2009, 05:23 PM
|
|
Registered User
|
|
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
|
|
|
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.
|

07-04-2009, 08:24 PM
|
 |
Forum Guru
|
|
Join Date: 21 Mar 2008
Location: Bakersfield, CA
MS Office Version:2003 (can read 2007 files)
Posts: 9,330
|
|
|
Re: creating the pattern C7,C14,C21...
Quote:
Originally Posted by Ancalagon12321
@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!)
|

07-04-2009, 09:19 PM
|
 |
Forum Guru
|
|
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 5,967
|
|
|
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.
|

07-04-2009, 09:24 PM
|
|
Registered User
|
|
Join Date: 03 Jul 2009
Location: London, England
MS Office Version:Excel 2003
Posts: 17
|
|
|
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.
|
 |
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|