LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
DEE DEE is offline
external usenet poster
 
Posts: 250
Default copy and insert throwing error- help in code req

hi,
I have the following code which merges cells... but before merging, i am
taking 3 rows from sheet2 , copying it and putting it into my FTP sheet
.. but it throws error.. can any1 help me in the section "inserting 3 rows"..
merging is happening fine.. all i need is taht the 3 rows should be added
dynamically before merging... pls help in rectifying


i have given portion of teh entire code here

For i1 = 3 To e
If (ps < Range("C" & i1)) Then

'' 'insertion 3 rows
Sheets("Sheet2").Select
Rows("1:3").Select
Selection.Copy
Sheets("FTP").Select
Range("E" & i1).Select
Selection.Insert Shift:=xlDown
ActiveWindow.ActivateNext

'' 'end of insertion of three rows

Range("B" & st & ":B" & i1 - 1).merge
Range("A" & st & ":A" & i1 - 1).merge
Range("C" & st & ":C" & i1 - 1).merge

ps = Range("C" & i1)
st = i1
ElseIf (ps = Range("C" & i1) And i1 < 3) Then
Range("A" & i1) = ""
Range("B" & i1) = ""
Range("C" & i1) = ""
'Range("D" & i1) = ""


End If


Next i1
 
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
aconcat UDF throwing a #NAME error Josh Rogers Excel Worksheet Functions 10 February 14th 08 07:29 PM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
How to insert code Karl Excel Discussion (Misc queries) 3 January 8th 07 11:01 PM
Throwing Out top & lower percentages Gary Gonzales Excel Worksheet Functions 2 February 23rd 06 08:30 PM
Insert Code Derek Y via OfficeKB.com New Users to Excel 3 October 17th 05 03:48 AM


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