Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy and paste only filtered cells
I am attempting to do the following to a filtered spreadsheet via a macro:
a) Filter a spreadsheet based on values in column A -- no problem b) Paste a text value (i.e. the word "Cash") into the cells (subject to the filter) which appear in column B all the way down to the last row as determined by the filter on Column A. In other words, paste this text value in every row of column B -- but the rows are based on the filtered values of column A. Any assistance? Many thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy and paste only filtered cells
Eric_G wrote:
I am attempting to do the following to a filtered spreadsheet via a macro: a) Filter a spreadsheet based on values in column A -- no problem b) Paste a text value (i.e. the word "Cash") into the cells (subject to the filter) which appear in column B all the way down to the last row as determined by the filter on Column A. In other words, paste this text value in every row of column B -- but the rows are based on the filtered values of column A. Any assistance? Many thanks. Copy something to the clipboard (i.e, "Cash") Select the last visible, pertinent cell in column B Ctrl+Shift+Arrow Up (now many cells are selected) Shift+Arrow Down enough times so your column header is not selected Paste |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy and paste only filtered cells
Eric,
This does it with VBA: Sub Test() Dim lngLastRow As Long With ActiveSheet With .Range("A2") .AutoFilter .AutoFilter Field:=1, Criteria1:="a" End With lngLastRow = .Range("A" & .Rows.Count).End(xlUp).Row .Range("B2:B" & lngLastRow).Value = "cash" End With End Sub If you actually want it to paste something that's previously copied, that would take a little more code. hth, Doug "Eric_G" wrote in message ... I am attempting to do the following to a filtered spreadsheet via a macro: a) Filter a spreadsheet based on values in column A -- no problem b) Paste a text value (i.e. the word "Cash") into the cells (subject to the filter) which appear in column B all the way down to the last row as determined by the filter on Column A. In other words, paste this text value in every row of column B -- but the rows are based on the filtered values of column A. Any assistance? Many thanks. __________ Information from ESET NOD32 Antivirus, version of virus signature database 4237 (20090712) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 4237 (20090712) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filtered copy and paste error | Excel Discussion (Misc queries) | |||
Copy and paste - filtered data | Excel Discussion (Misc queries) | |||
copy and paste filtered cells | Excel Discussion (Misc queries) | |||
Copy and Paste Filtered Cells in Excel 2007 | Excel Discussion (Misc queries) | |||
copy and paste filtered data | Excel Discussion (Misc queries) |