PC Review


Reply
Thread Tools Rate Thread

Change Cell Value when autofiltered

 
 
condorstats@gmail.com
Guest
Posts: n/a
 
      16th Jan 2007
Hi,

Please see the code below, and see if you can make sense of what I am
saying here.

Sheets("Countdown Report").Select
Range("J2").Select
ActiveCell.FormulaR1C1 = _
"=COUNTIF('Pending Report'!C[-7],'Countdown Report'!RC[-9])"
Selection.AutoFill Destination:=Range("J2:J500")
Range("J2:J500").Select

Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=10, Criteria1:="0"
Range("I1").Select
ActiveCell.Offset(1, 0).Select
Do Until IsEmpty(ActiveCell)
If ActiveCell.EntireRow.Hidden = False Then
ActiveCell.Value = "Picked/No Stock"
End If
ActiveCell.Offset(1, 0).Select
Loop

Ok, so the countif is calculating correctly, however, its the next bit
that is giving me some trouble. All i want to do is change the value of
the Status cells, which are in column I for me, to a certain value,
depending on the countif result. I have to repeat this 3 times against
different reports, and so at the end i should have different types of
entry. However, the code above changes every cell to whatever i set
ActiveCell.Value to, regardless of the filtering of the data.

Any help is greatly appreciated.

Thanks,
John.

 
Reply With Quote
 
 
 
 
condorstats@gmail.com
Guest
Posts: n/a
 
      19th Jan 2007
bump?
(E-Mail Removed) wrote:
> Hi,
>
> Please see the code below, and see if you can make sense of what I am
> saying here.
>
> Sheets("Countdown Report").Select
> Range("J2").Select
> ActiveCell.FormulaR1C1 = _
> "=COUNTIF('Pending Report'!C[-7],'Countdown Report'!RC[-9])"
> Selection.AutoFill Destination:=Range("J2:J500")
> Range("J2:J500").Select
>
> Rows("1:1").Select
> Selection.AutoFilter
> Selection.AutoFilter Field:=10, Criteria1:="0"
> Range("I1").Select
> ActiveCell.Offset(1, 0).Select
> Do Until IsEmpty(ActiveCell)
> If ActiveCell.EntireRow.Hidden = False Then
> ActiveCell.Value = "Picked/No Stock"
> End If
> ActiveCell.Offset(1, 0).Select
> Loop
>
> Ok, so the countif is calculating correctly, however, its the next bit
> that is giving me some trouble. All i want to do is change the value of
> the Status cells, which are in column I for me, to a certain value,
> depending on the countif result. I have to repeat this 3 times against
> different reports, and so at the end i should have different types of
> entry. However, the code above changes every cell to whatever i set
> ActiveCell.Value to, regardless of the filtering of the data.
>
> Any help is greatly appreciated.
>
> Thanks,
> John.


 
Reply With Quote
 
Roger Govier
Guest
Posts: n/a
 
      19th Jan 2007
Hi

Try

Sheets("Countdown Report").Select
Range("J2").Select
ActiveCell.FormulaR1C1 = _
"=COUNTIF('Pending Report'!C[-7],'Countdown Report'!RC[-9])"
Selection.AutoFill Destination:=Range("J2:J500")
Range("J2:J500").Select

Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=10, Criteria1:="0"
Range("I2").Select
for i= 2 to 500
If ActiveCell.EntireRow.Hidden = False Then
ActiveCell.Value = "Picked/No Stock"
End If
Next

--
Regards

Roger Govier


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> Please see the code below, and see if you can make sense of what I am
> saying here.
>
> Sheets("Countdown Report").Select
> Range("J2").Select
> ActiveCell.FormulaR1C1 = _
> "=COUNTIF('Pending Report'!C[-7],'Countdown Report'!RC[-9])"
> Selection.AutoFill Destination:=Range("J2:J500")
> Range("J2:J500").Select
>
> Rows("1:1").Select
> Selection.AutoFilter
> Selection.AutoFilter Field:=10, Criteria1:="0"
> Range("I1").Select
> ActiveCell.Offset(1, 0).Select
> Do Until IsEmpty(ActiveCell)
> If ActiveCell.EntireRow.Hidden = False Then
> ActiveCell.Value = "Picked/No Stock"
> End If
> ActiveCell.Offset(1, 0).Select
> Loop
>
> Ok, so the countif is calculating correctly, however, its the next bit
> that is giving me some trouble. All i want to do is change the value
> of
> the Status cells, which are in column I for me, to a certain value,
> depending on the countif result. I have to repeat this 3 times against
> different reports, and so at the end i should have different types of
> entry. However, the code above changes every cell to whatever i set
> ActiveCell.Value to, regardless of the filtering of the data.
>
> Any help is greatly appreciated.
>
> Thanks,
> John.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make the first cell in autofiltered list the activecell? =?Utf-8?B?UGV0ZXJz?= Microsoft Excel Programming 3 29th Jul 2007 05:38 PM
In Macros within the autofiltered icon to change data how possible =?Utf-8?B?VmlqYXkgS290aWFu?= Microsoft Excel Misc 0 5th Sep 2006 04:45 PM
In Macro How can i Change Autofiltered data one by one =?Utf-8?B?VmlqYXkgS290aWFu?= Microsoft Excel Misc 1 5th Sep 2006 10:46 AM
Enter a "checkmark" in an AutoFiltered cell L Mehl Microsoft Excel Programming 2 27th Sep 2004 12:30 AM
Autofiltered cell value (VBA) Jaro Microsoft Excel Programming 1 25th Aug 2004 11:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:17 AM.