Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to copy & paste-special-values data to selected worksheets tomhelle Excel Discussion (Misc queries) 1 May 5th 10 02:00 PM
Identify row based on criteria and copy paste special values only S Himmelrich Excel Programming 4 July 20th 09 09:45 PM
Copy range in macro using paste special values Jeff Excel Discussion (Misc queries) 2 August 20th 07 08:12 PM
Macro to copy and paste special values bobby Excel Programming 1 November 7th 05 08:06 AM
Macro to copy and paste special values bobby Excel Programming 0 November 7th 05 05:45 AM


All times are GMT +1. The time now is 12:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"