View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default 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