Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro copy data based on cell formatting and paste special values
I would like to create a macro that copies data (based on cell formatting) on
one sheet (Qry Data) and pastes this data (paste special values) to the next available line on another sheet (Audit Data). It is like that rows of data won't be adjacent, but the column data will always be adjacent. Does anyone have a macro that could do this? -- Drew |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro copy data based on cell formatting and paste special values
your description of what you want to copy leaves a lot of latitude for the
criteria. However, lets assume the formatting is bold font in column A. Sub cpyBold() Dim lr As Long, rng As Range, c As Range Dim sh1 As Worksheet, sh2 As Worksheet Set sh1 = Sheets("Qry Data") Set sh2 = Sheets("Audit Data") lr = sh1.Cells(Rows.Count, 1).End(xlUp).Row Set rng = sh1.Range("A2:A" & lr) For Each c In rng If Not IsEmpty(c) And c.Font.Bold = True Then c.EntireRow.Copy x = sh2.Cells(Rows.Count, 1).End(xlUp).Offset(1).Address sh2.Range(x).PasteSpecial Paste:=xlValues End If Next End Sub "Drew" wrote in message ... I would like to create a macro that copies data (based on cell formatting) on one sheet (Qry Data) and pastes this data (paste special values) to the next available line on another sheet (Audit Data). It is like that rows of data won't be adjacent, but the column data will always be adjacent. Does anyone have a macro that could do this? -- Drew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to copy & paste-special-values data to selected worksheets | Excel Discussion (Misc queries) | |||
Identify row based on criteria and copy paste special values only | Excel Programming | |||
Copy range in macro using paste special values | Excel Discussion (Misc queries) | |||
Macro to copy and paste special values | Excel Programming | |||
Macro to copy and paste special values | Excel Programming |