Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 213
Default Formula/ Macro that will copy and paste

I am creating a number of spreadsheets that have multiple links with each
other. One link I am trying to make is this: Condition: If column L has text
"NSI", then copy and paste entire row to a separate worksheet. However, I
need it to paste in a sequential order begining with row 2 of the new sheet
and not in the same row it is copied from on the new sheet. I am probably on
the bottom end of the advanced scale of Excel and would greatly appreciate
any assistance anyone can offer. Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Formula/ Macro that will copy and paste

Hi,

Alt + F11 to open VB editor. right click 'This workbook' insert module and
paste this in and run it.

Sub stance()
Dim myrange
Dim copyrange As Range
Sheets("Sheet1").Select
Lastrow = Cells(Cells.Rows.Count, "L").End(xlUp).Row
Set myrange = Range("L1:L" & Lastrow)
For Each C In myrange
If UCase(C.Value) = "NSI" Then
If copyrange Is Nothing Then
Set copyrange = C.EntireRow
Else
Set copyrange = Union(copyrange, C.EntireRow)
End If
End If
Next
If Not copyrange Is Nothing Then
copyrange.Copy
End If
Sheets("Sheet2").Select
Range("A2").Select
ActiveSheet.Paste
End Sub

Mike

"Randy" wrote:

I am creating a number of spreadsheets that have multiple links with each
other. One link I am trying to make is this: Condition: If column L has text
"NSI", then copy and paste entire row to a separate worksheet. However, I
need it to paste in a sequential order begining with row 2 of the new sheet
and not in the same row it is copied from on the new sheet. I am probably on
the bottom end of the advanced scale of Excel and would greatly appreciate
any assistance anyone can offer. Thank you.

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 and paste LALA Excel Discussion (Misc queries) 1 May 16th 08 04:46 AM
macro to copy and paste estella Excel Discussion (Misc queries) 1 May 16th 08 04:43 AM
copy and paste using macro kate Excel Discussion (Misc queries) 3 May 22nd 07 07:41 PM
Copy/Paste Macro Diana Excel Discussion (Misc queries) 1 July 7th 06 08:14 PM
I need formula help or create a macro to copy and paste value only Rebecca Excel Discussion (Misc queries) 4 April 8th 06 01:18 PM


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