LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Macro Script help

Need some help please, somebody has provided me with the the following macro
and I need to make a change but i'm not exactly sure how to implement the
change.

At present I am unable to get in touch with the person , that provided it
and I need to try and get this all done this afternoon.
The instruction was as follows : "you might have some unwanted spaces in at
the begining or end of the data.Try altering the second line as shown below"

How do i put this

For Each Dn1 In Rng1
If Trim(Dn2) = Trim(Dn1) Then 'Alter this line

into this, do i append it to line 2 or what.

thanks if you can help

Sub compare
Dim Rng1 As Range, Dn1 As Range, Rng2 As Range, Dn2 As Range
With Sheets("Sheet1") '1
Set Rng1 = .Range(.Range("E1"), .Range("E" & Rows.Count).End(xlUp))
End With
With Sheets("Sheet2") '2
Set Rng2 = .Range(.Range("E1"), .Range("E" & Rows.Count).End(xlUp))
End With
For Each Dn2 In Rng2
For Each Dn1 In Rng1
If Dn2 = Dn1 Then
Dn1.Offset(, -4).Resize(, 31).Copy Dn2.Offset(, -4).Resize(,
31)
End If
Next Dn1
Next Dn2
End Sub


 
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
Formating/Macro/Script Help Shepord Excel Discussion (Misc queries) 7 September 30th 09 10:04 PM
Macro Script mldancing Excel Discussion (Misc queries) 2 March 15th 07 08:35 PM
VB script/macro help - please !! Anthony Excel Discussion (Misc queries) 2 July 10th 05 07:58 PM
Macro script error - pls help !! Anthony Excel Discussion (Misc queries) 3 February 28th 05 01:49 PM


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