Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default CountA, Subtotal and "move to the first cell in the next column"

Help,
I am using the"CountA" Worksheet function to paste data from another
sheet into the 1st empty cell starting at "B2". It works fine all the
way to row 14 but it continues to row 15.

I want it to reset the CountA function to 2 and not keep count 15 and
start all over at column "D2" down to "D14" and repeat to column "F2"
and so on.


What as I doing wrong? How do I do it?


MY CODES:


Sheets("Sheet1").Select
Range("A1").Select
'------------------------------------------------------------------------
''Column_Index_For_Calculation was initailzed to 0.
-----------------------------------------------------------------------


Column_Index_For_Calculation = Column_Index_For_Calculation + 1
second_MyRow = ActiveCell.row
second_MyCol = ActiveCell.Column
NumColumns = My_Current_Range.Columns.Count
'--------------------------------------------------------------------------*---------------------------------
Sheets("The Calculations").Select
Calculation_Column = second_MyCol + Column_Index_For_Calculation
---------------------------------------------------------------------------*--------------------------------
'Calculation_Column is at 4
Change_The Columns is at True
---------------------------------------------------------------------------*---------------
New_Calculation_Column: If Change_The_Columns = True Then

Selection.End(xlUp).Select
Selection.Offset(1,
0).Select
'Next_Line = 2
ActiveCell.Select
End If
'--------------------------------------------------------------------------*---------------------------------------------
Next_Line = Application.WorksheetFunction.CountA(Range("b:b"),
NumColumns)
'--------------------------------------------------------------------------*-------------------------------------------
'--------------------------------------------------------------------------*--------------------------------------------
' Next line is 15 not 2. I cannot make it to restart the count on the
next column.


'--------------------------------------------------------------------------*----------------------------------------------
'--------------------------------------------------------------------------*-----------------------------------------------
Cells(Next_Line, Calculation_Column) = Date_For_Calculation '
DATES
Cells(Next_Line, (Calculation_Column + 1)) = Diff_for_Calculations
'DIFF
'--------------------------------------------------------------------------*--------------------------------------------
'--------------------------------------------------------------------------*--------------------------------------------
A B C D F
GAMES DATES DIFF DATE DIFF
1st item 1/17/2006 14 11/25/07 4
2nd item 1/31/2006 21
3rd item 2/21/2006 143
4th item 7/14/2006 25
5th item 8/8/2006 59
6th item 10/6/2006 35
7th item 11/10/2006 84
8th item 2/2/2007 18
9th item 2/20/2007 31
10th item 3/23/2007 18
11th item 4/10/2007 7
12th item 4/17/2007 3
13th item 4/20/2007 4
14th item 4/24/2007 52
15th item 11/25/2005 4

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default CountA, Subtotal and "move to the first cell in the next column"

Again. You will not make friends posting in multiple groups.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"LongBeachGuy" wrote in message
ups.com...
Help,
I am using the"CountA" Worksheet function to paste data from another
sheet into the 1st empty cell starting at "B2". It works fine all the
way to row 14 but it continues to row 15.

I want it to reset the CountA function to 2 and not keep count 15 and
start all over at column "D2" down to "D14" and repeat to column "F2"
and so on.


What as I doing wrong? How do I do it?


MY CODES:


Sheets("Sheet1").Select
Range("A1").Select
'------------------------------------------------------------------------
''Column_Index_For_Calculation was initailzed to 0.
-----------------------------------------------------------------------


Column_Index_For_Calculation = Column_Index_For_Calculation + 1
second_MyRow = ActiveCell.row
second_MyCol = ActiveCell.Column
NumColumns = My_Current_Range.Columns.Count
'--------------------------------------------------------------------------*---------------------------------
Sheets("The Calculations").Select
Calculation_Column = second_MyCol + Column_Index_For_Calculation
---------------------------------------------------------------------------*--------------------------------
'Calculation_Column is at 4
Change_The Columns is at True
---------------------------------------------------------------------------*---------------
New_Calculation_Column: If Change_The_Columns = True Then

Selection.End(xlUp).Select
Selection.Offset(1,
0).Select
'Next_Line = 2
ActiveCell.Select
End If
'--------------------------------------------------------------------------*---------------------------------------------
Next_Line = Application.WorksheetFunction.CountA(Range("b:b"),
NumColumns)
'--------------------------------------------------------------------------*-------------------------------------------
'--------------------------------------------------------------------------*--------------------------------------------
' Next line is 15 not 2. I cannot make it to restart the count on the
next column.


'--------------------------------------------------------------------------*----------------------------------------------
'--------------------------------------------------------------------------*-----------------------------------------------
Cells(Next_Line, Calculation_Column) = Date_For_Calculation '
DATES
Cells(Next_Line, (Calculation_Column + 1)) = Diff_for_Calculations
'DIFF
'--------------------------------------------------------------------------*--------------------------------------------
'--------------------------------------------------------------------------*--------------------------------------------
A B C D F
GAMES DATES DIFF DATE DIFF
1st item 1/17/2006 14 11/25/07 4
2nd item 1/31/2006 21
3rd item 2/21/2006 143
4th item 7/14/2006 25
5th item 8/8/2006 59
6th item 10/6/2006 35
7th item 11/10/2006 84
8th item 2/2/2007 18
9th item 2/20/2007 31
10th item 3/23/2007 18
11th item 4/10/2007 7
12th item 4/17/2007 3
13th item 4/20/2007 4
14th item 4/24/2007 52
15th item 11/25/2005 4

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
CountA, Subtotal and "move to the first cell in the next column" LongBeachGuy Excel Discussion (Misc queries) 1 October 16th 07 10:57 PM
Click "Enter" move to cell to the right, not down in Excel Art Bahrnone Excel Worksheet Functions 1 March 20th 07 03:38 AM
why does "=counta(d9:d44)" return "37" imfletcher Excel Discussion (Misc queries) 2 August 31st 06 08:39 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM
Is it possible to create a button for a formula? ie. "CountA" wheresleo Excel Discussion (Misc queries) 0 January 30th 06 09:13 PM


All times are GMT +1. The time now is 05:59 AM.

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

About Us

"It's about Microsoft Excel"