PC Review


Reply
Thread Tools Rate Thread

after filtering, change every cell in column J

 
 
John Keith
Guest
Posts: n/a
 
      12th Nov 2009
After autofiltering a range of data I next want to change the value of
column J of every row found to "1". What is the mechanism for
specifying the sorted range and changing the value?


John Keith
(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      12th Nov 2009
If you need to apply the filter:

Sub TryNow()
Dim myR As Range
Set myR = ActiveCell.CurrentRegion
'Apply your filter
myR.AutoFilter Field:=7, Criteria1:=">=65", Operator:=xlAnd
Intersect(myR, Range("J2:J" & Rows.Count)).SpecialCells(xlCellTypeVisible).Value = 1
myR.AutoFilter
End Sub

Otherwise, if the filter is applied already

Sub SetJ()

Intersect(ActiveSheet.UsedRange, ActiveSheet.Range("J2:J" & Rows.Count)) _
.SpecialCells(xlCellTypeVisible).Value = 1

End Sub

--
HTH,
Bernie
MS Excel MVP


"John Keith" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> After autofiltering a range of data I next want to change the value of
> column J of every row found to "1". What is the mechanism for
> specifying the sorted range and changing the value?
>
>
> John Keith
> (E-Mail Removed)



 
Reply With Quote
 
John Keith
Guest
Posts: n/a
 
      13th Nov 2009
Bernie,

Thank you, I'll try it out this weekend.

>Sub SetJ()
>
>Intersect(ActiveSheet.UsedRange, ActiveSheet.Range("J2:J" & Rows.Count)) _
> .SpecialCells(xlCellTypeVisible).Value = 1
>
>End Sub



John Keith
(E-Mail Removed)
 
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
Keep boarder on merged cell while filtering data in another column ckc95 Microsoft Excel Setup 0 2nd Feb 2010 09:50 PM
VBA to address first visible cell in Column "D" after filtering EagleOne Microsoft Excel Misc 2 11th Dec 2006 05:22 PM
change cell colour if value in column = x?? Simon Lloyd Microsoft Excel Programming 5 23rd Mar 2006 07:00 AM
trouble filtering a list. Why isn't column filtering? =?Utf-8?B?UGF0?= Microsoft Excel Worksheet Functions 1 18th Jul 2005 03:30 PM
Any way to change all references to one column (in a cell) to another column? ModelerGirl Microsoft Excel Misc 2 28th Feb 2004 12:57 AM


Features
 

Advertising
 

Newsgroups
 


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