ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Update cells, from a filter (https://www.excelbanter.com/excel-programming/360527-update-cells-filter.html)

alvin Kuiper

Update cells, from a filter
 
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

Bob Phillips[_14_]

Update cells, from a filter
 
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




alvin Kuiper

Update cells, from a filter
 
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





Bob Phillips[_14_]

Update cells, from a filter
 
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







alvin Kuiper

Update cells, from a filter
 
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







Tom Ogilvy

Update cells, from a filter
 
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







alvin Kuiper

Update cells, from a filter
 
Hi tom and thanks

But i get this error
In line:
Set rng = rng.Offset(1, 0).Resize(rng.Count - 1, 1)
It says
Object variable or with block variable not set.
Do i something Wrong?

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







alvin Kuiper

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







alvin Kuiper

Update cells, from a filter
 
Forget it all

I can see now how its working !!!!!!!!!!!!!!!!!!!!!!!!!!!

Many thanks

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







Tom Ogilvy

Update cells, from a filter
 
I used columns(2) as an example - you didn't provide any details in your
original post. If your filter is only one column wide, then you don't even
need the intersect.


--
Regards,
Tom Ogilvy

"alvin Kuiper" wrote in message
...
Forget it all

I can see now how its working !!!!!!!!!!!!!!!!!!!!!!!!!!!

Many thanks

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









alvin Kuiper

Update cells, from a filter
 
Yes yes
Its working fine now thanks

Alvin


"Tom Ogilvy" wrote:

I used columns(2) as an example - you didn't provide any details in your
original post. If your filter is only one column wide, then you don't even
need the intersect.


--
Regards,
Tom Ogilvy

"alvin Kuiper" wrote in message
...
Forget it all

I can see now how its working !!!!!!!!!!!!!!!!!!!!!!!!!!!

Many thanks

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











All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com