LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Want code to copy to ABOVE row 22 column A on sheet 1


This portion of code works just fine to copy to sheet 1 EXCEPT it sees the permanent data in A22:Z22 and copies very nicely BELOW that data in row 22.

Set nRow = Sheets("Sheet1").Cells(Rows.Count, "A21").End(xlUp)
If nRow.Value = "" Then
Range("A1:Z4").Copy nRow
Range("A1:Z4").ClearContents
ElseIf nRow.Value < "" Then
Range("A1:Z4").Copy nRow.Offset(3, 0)
Range("A1:Z4").ClearContents
End If


I modified this line, which worked fine on a different sheet, to copy to Sheet1 above row A22. On the other sheet, column AC is 'clean' from top to bottom. Apparently it does not recognize the 21 with the column A and copies below the existing data in A22:Z22.

Set nRow = Cells(Rows.Count, "AC").End(xlUp)

How do I make start from A21 and go up from there on sheet 1?

Thanks,
Howard


 
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
Code to copy column in sheet 1 to column in sheet 2 based on matched criteria skitsoni Excel Programming 1 July 14th 12 11:25 AM
Help to code Macro to Copy fron one sheet and paste in other sheet kay Excel Programming 3 July 25th 08 06:46 PM
VB code to copy sheet format to another sheet ASU Excel Discussion (Misc queries) 12 August 10th 06 02:37 AM
how to make one column copy from one sheet to anoth column w/o zer areezm Excel Discussion (Misc queries) 3 June 6th 06 10:45 PM
How do i copy a active sheet to a new sheet with code and everything Karill Excel Programming 2 April 11th 06 06:22 PM


All times are GMT +1. The time now is 04:57 PM.

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

About Us

"It's about Microsoft Excel"