Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Newbie Needs some help

Hi Folks

Have been trying to create my first attempt at a macro, and need some basic help regarding 2 items

Ques
I want to create a results based on a range of data. ie If countif a1 / count (G1:G5), where the results displayed would be say 2 / 5. I've managed to code it but don't understand how to convert the RC values to A1:B1 type values. Here is code which work versus my guess.

ActiveCell.FormulaR1C1 = "=CONCATENATE(COUNTIF(Sheet1!RC[5]:R[7]C[5],""<1""),"" /"",COUNT(Sheet1!RC[5]:R[7]C[5]))

ActiveCell.FormulaR1C1 = "=CONCATENATE(COUNTIF(range(Sheet1!G2:G6)),""<1"") ,"" /"",COUNT(range(Sheet1!G2:G6)))

Can someone explain how I can convert the RC to A:B type.

Ques 2
I want to do a similar thing but have a criteria which is countif A between 1 and 1.3 (1<1.3) / count(G2:G5)

thanks in advance....
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Newbie Needs some help

The "equivalent" to your first line of code in A1 format is:

ActiveCell.Formula =
"=CONCATENATE(COUNTIF(Sheet1!F1:F8,""<1""),""/"",COUNT(Sheet1!F1:F8))"

IF the active cell is A1. Be sure that you understand the difference
between using the R1C1 and A1 reference styles though. There is no true
equivalent of the R1C1 macro in A1 format. The range referenced with the
R1C1 macro will always be dependent on what is the active cell when the
macro is run (the referenced range will start 5 columns to the right of it).
The A1 macro (above) will always reference the range F1:F8 regardless of the
active cell.

--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Newbie Needs some help

Thanks, that worked a treat... I understand the RC1 problem, thats why I preferred to be able to write in A1 notation...
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
vba newbie need help. Oligo Excel Discussion (Misc queries) 2 November 5th 08 07:22 PM
newbie ? Charles Eaves New Users to Excel 1 July 28th 08 09:11 AM
Please help Newbie Bblatz Excel Worksheet Functions 1 April 23rd 08 09:21 AM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Newbie Help. Is this possible? taltos1 Excel Discussion (Misc queries) 5 November 12th 05 04:40 PM


All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"