Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default Counting macro

Hello all,
I am trying to have a macro count the number of lines down if it doesn't
match the last line.
ie:
Date c1 c2 c3
11/8 10 20 30
11/8 10 20 30
11/8 10 20 30
11/8 10 20 30

If I have 4 rows of info and the new date is now 11/9 it won't match row 4
but I want it to count down from row one to row three and replace the
information on rows three and four. If I had to count down two rows then row
three and four would have the date and info as follows:

ie: (Go down 2 row)
Date c1 c2 c3
11/8 10 20 30
11/8 10 20 30
11/9 20 30 40
11/9 20 30 40

This would carrie on for 400 rows. I hope this makes sense. If not I will
try to explain again.

Eric


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Counting macro

Eric,

I think I know what your trying to do. Are you familiar with using the
{countif} formula. I believe using that may solve your problem without using
a macro. That is, unless you just need to know the address of the first cell
that deviates from the condition. If that is the case, you may be able to
still use {countif}, with another nested {if} statement. Let me know if this
helps. If not, please elaborate on what your desired result is.

"Eric" wrote:

Hello all,
I am trying to have a macro count the number of lines down if it doesn't
match the last line.
ie:
Date c1 c2 c3
11/8 10 20 30
11/8 10 20 30
11/8 10 20 30
11/8 10 20 30

If I have 4 rows of info and the new date is now 11/9 it won't match row 4
but I want it to count down from row one to row three and replace the
information on rows three and four. If I had to count down two rows then row
three and four would have the date and info as follows:

ie: (Go down 2 row)
Date c1 c2 c3
11/8 10 20 30
11/8 10 20 30
11/9 20 30 40
11/9 20 30 40

This would carrie on for 400 rows. I hope this makes sense. If not I will
try to explain again.

Eric


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default Counting macro

I don't know if the countif statement would work. Would like to use a macro
if possible. What I want to do is populate the entire sheet and after if
something changes on a design then change everything for the sheet from the
test on down.
IE:
If I have room for 400 rows or (tests) of info and each column has different
information. After test number 10 I need to change the information in column
"C" only. I want everything from row 11 (Test 11) to row 400 to be the same.
This will happen each time I need to make a change.

In this example everything from row 1 to 10 would be the same. Rows 11 to
400 would be the same. Does this help any?

Eric

"Lonpuz" wrote:

Eric,

I think I know what your trying to do. Are you familiar with using the
{countif} formula. I believe using that may solve your problem without using
a macro. That is, unless you just need to know the address of the first cell
that deviates from the condition. If that is the case, you may be able to
still use {countif}, with another nested {if} statement. Let me know if this
helps. If not, please elaborate on what your desired result is.

"Eric" wrote:

Hello all,
I am trying to have a macro count the number of lines down if it doesn't
match the last line.
ie:
Date c1 c2 c3
11/8 10 20 30
11/8 10 20 30
11/8 10 20 30
11/8 10 20 30

If I have 4 rows of info and the new date is now 11/9 it won't match row 4
but I want it to count down from row one to row three and replace the
information on rows three and four. If I had to count down two rows then row
three and four would have the date and info as follows:

ie: (Go down 2 row)
Date c1 c2 c3
11/8 10 20 30
11/8 10 20 30
11/9 20 30 40
11/9 20 30 40

This would carrie on for 400 rows. I hope this makes sense. If not I will
try to explain again.

Eric


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
macro runs counting sisco98 Excel Programming 6 June 3rd 05 02:42 PM
Counting how long a Macro takes to run Diane Alsing Excel Programming 2 February 7th 05 05:41 PM
Counting cells in a macro Chip Pearson Excel Programming 1 September 17th 04 10:15 PM
Counting cells in a macro Tony Excel Programming 0 September 17th 04 09:43 PM
Counting specified words in a column - macro if possible John Hayden Excel Programming 1 July 6th 04 06:08 PM


All times are GMT +1. The time now is 04:51 PM.

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"