#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Copy paste

Hi All

I have a written macro that sort a range form A1:F510

But if #N/A is in the F column I want to copy the values in A column to
another cells. Can anyone help me with that.

Geir

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy paste

Sub CopyData()
dim rng as range, cell as Range
Dim rw as Long

On Error Resume Next
set rng = Range("F1:F510").SpecialCells(xlformulas,xlErrors)
On Error goto 0
rw = 0
if not rng is nothing then
for each cell in rng
if cell.Text = "#N/A" then
rw = rw + 1
cells(rw,"G").Value = cells(cell.row,"A").Value
end if
Next
End if
End Sub

--
Regards,
Tom Ogilvy

"Geir" wrote in message
...
Hi All

I have a written macro that sort a range form A1:F510

But if #N/A is in the F column I want to copy the values in A column to
another cells. Can anyone help me with that.

Geir



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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy, paste without file name referenced after paste AusTexRich Excel Discussion (Misc queries) 6 September 23rd 08 02:57 AM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
Macro to Copy/Paste then Paste to Next Line tomkarakowski Excel Programming 1 May 28th 04 01:19 AM


All times are GMT +1. The time now is 06:35 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"