Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding new rows

Hello,

Any help with this solution would be greatly appreciated.

I have two sheets (sheet1 and sheet2). In sheet1 one I do som
filtering. Sheet2 looks like this:

Priority1


Priority2
Priority3



Priority4

I would like to move the results(rows) from the filtered sheet1 an
insert between Priority2 and Priority3, and push down the labe
Priority3.

Thanks in advace

--
Message posted from http://www.ExcelForum.com

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

Sub Tester1()
Dim rng As Range, rng1 As Range
Dim rng2 As Range
With Worksheets("Sheet1")
Set rng = .AutoFilter.Range
End With
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1)
numRow = rng.Columns(1).SpecialCells(xlVisible).Count
rng.Copy
With Worksheets("Sheet2")
Set rng1 = .Columns(1).Find("Priority3")
End With
If Not rng1 Is Nothing Then
Set rng2 = rng1.Offset(-1, 0)
rng1.EntireRow.Resize(numRow).Insert
rng.Copy
Worksheets("Sheet2").Paste rng2.Offset(1, 0)
End If

End Sub

--
Regards,
Tom Ogilvy



"sk8rider " wrote in message
...
Hello,

Any help with this solution would be greatly appreciated.

I have two sheets (sheet1 and sheet2). In sheet1 one I do some
filtering. Sheet2 looks like this:

Priority1


Priority2
Priority3



Priority4

I would like to move the results(rows) from the filtered sheet1 and
insert between Priority2 and Priority3, and push down the label
Priority3.

Thanks in advace.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding new rows

Thanks a lot Tom your post helped me resolved my issue.

Take care

--
Message posted from http://www.ExcelForum.com

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
Adding rows based on no of rows specified from a given position nanette Excel Worksheet Functions 1 July 9th 08 02:29 PM
Adding five new rows every 40 rows in a spreadsheet? Olzki Excel Discussion (Misc queries) 8 May 18th 07 02:14 AM
Adding rows? cambanis Excel Worksheet Functions 3 September 17th 06 10:48 PM
Adding Rows offsets to working rows across two worksheets tom Setting up and Configuration of Excel 3 July 30th 06 07:54 PM
VBA - Adding Rows halem2 Excel Programming 1 May 26th 04 02:18 PM


All times are GMT +1. The time now is 05:19 AM.

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"