View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
alvin Kuiper alvin Kuiper is offline
external usenet poster
 
Posts: 175
Default Update cells, from a filter

Hi tom
its working now
It was because i only have value in one collum (A)
when i try the code with value also in B then the code works
But i use autofilter in A and the code runs in B
so my values in B gets +10 not A ???

Regards
Alvin


"Tom Ogilvy" wrote:

Dim rng as Range, rng1 as Range
set rng = activesheet.Autofilter.Range
set rng = Intersect(rng,columns(2))
set rng = rng.offset(1,0).Resize(rng.count-1,1)
on error resume next
set rng1 = rng.specialcells(xlvisible)
On error goto 0
if not rng1 is nothing then
for each cell in rng1
cell.value = cell.value + 10
Next
End if

--
Regards,
Tom Ogilvy


"alvin Kuiper" wrote:

Yes its working
but its also take the empty cells

I use filter in a collum
but when i select only visible then
i also get the empty cells.

Regards
alvin


"Bob Phillips" skrev:

Use the macro recorder when you do, there's your code.

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"alvin Kuiper" wrote in message
...
thanks
But is'n there away to do this in a macro I can use?

Alvin


"Bob Phillips" skrev:

After filtering, put the value 10 in another cell and copy it. Then
select
the visible cells that you want to update, goto EditPasteSpecial and
click
the Add box. Exit, and clear the cell with 10 in it.

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"alvin Kuiper" wrote in message
...
Hi
If i use a filter i maybe ahve 200 records and when i use my filter i
have
10 records
the value in this cells are maybe 100 then i want this cells value to
be
the cells value +10

Hope someone understand and can help

regards
alvin