LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Insert Rows within Function

Currently the function below returns values and I have the seperated by
carrage return, however i wan to have all the values returned seperated into
new rows. Is there a way to get the data back seperated into new rows using
a subroutine?



Function MLookup(LookupRng As Range, OffsetVal As Integer, LookupVal As Range)
Dim r As Range

For Each r In LookupRng

If r.Value = LookupVal.Value Then
If Len(MLookup) = 0 Then
MLookup = r.Offset(0, OffsetVal - 1).Value
Else

MLookup = MLookup & vbCrLf & r.Offset(0, OffsetVal - 1).Value
End If
End If
Next r
End Function





 
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
How do i insert blank rows between data that is thousands of rows paul.eatwell Excel Discussion (Misc queries) 5 April 14th 08 10:49 PM
Function to insert rows on a change in a cell Subhash Excel Discussion (Misc queries) 3 March 19th 08 04:35 AM
Insert rows: Formats & formulas extended to additonal rows Twishlist Excel Worksheet Functions 0 October 22nd 07 04:23 AM
How do I insert blank rows between rows in completed worksheet? bblue1978 Excel Discussion (Misc queries) 1 October 26th 06 07:02 PM
How do i insert of spacer rows between rows in large spreadsheets laurel Excel Discussion (Misc queries) 0 April 24th 06 01:38 PM


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