filtering and copying

Kspider

New Member
Joined
Apr 14, 2003
Messages
26
Hope I can explain this right.
Ok , every morning I run a macro that compares the previous two days prices for items. Now under certain circumstances I want to replace the new price over an old price, if in fact it has changed over a certain tolerence. Now I have a diff column, which I use to filter the changes over tolerence, what I have been doing is hand inputting the new over old prices. I tried copying the filtered list, but when I paste it screws up. It starts in the cell I want, but starts pasting in the hidden cells. Is there a way around this?
Hope I made myself clear.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
Perhaps something like this will work, which selects visible cells only :-

Code:
Range("A2:C8").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.PasteSpecial Paste:=xlValues
 

Kspider

New Member
Joined
Apr 14, 2003
Messages
26
That works for copying the cells but the pasting over to adjacent cells is where the problems lies.

For example (sorry can't do the excel paste thing):

Price 1 Price 2 Diff
a1=20 b1=20 c1=00
a2=15 b2=25 c2=10
a3=12 b3=32 c3=20
a4=33 b4=33 c4=00
a5=22 b5=75 c5=53

I will filter for differences, and will get rows 2,3,5 visible. I want to able to copy the visible cells of b2,b3,b5 and paste them into a2,a3,a5.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,332
Messages
5,769,470
Members
425,552
Latest member
learnerrr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top