#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default concatif

How do I create this formula in VBA and use this on multiple cells? I've
never worked with this before
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default concatif

Betty,

There isn't a formula called Concatif so I guess you have a UDF called that.
If you explain what your trying to do in some detail then someone will help.

Mike

"Betty" wrote:

How do I create this formula in VBA and use this on multiple cells? I've
never worked with this before

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default concatif

JE McGimpsey created a UDF called MultiCat:
http://mcgimpsey.com/excel/udfs/multicat.html

You could start with his procedure and add your own criteria:

Option Explicit
Public Function concatif(ByRef rRng As Excel.Range, _
Optional ByVal sDelim As String = "") As String

Dim rCell As Range

For Each rCell In rRng.Cells
'add some criteria???
If rCell.Value = "" Then
'skip it
Else
concatif = concatif & sDelim & rCell.Text
End If
Next rCell

concatif = Mid(concatif, Len(sDelim) + 1)

End Function

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)




Betty wrote:

How do I create this formula in VBA and use this on multiple cells? I've
never worked with this before


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default concatif

Thank you so much

"Dave Peterson" wrote:

JE McGimpsey created a UDF called MultiCat:
http://mcgimpsey.com/excel/udfs/multicat.html

You could start with his procedure and add your own criteria:

Option Explicit
Public Function concatif(ByRef rRng As Excel.Range, _
Optional ByVal sDelim As String = "") As String

Dim rCell As Range

For Each rCell In rRng.Cells
'add some criteria???
If rCell.Value = "" Then
'skip it
Else
concatif = concatif & sDelim & rCell.Text
End If
Next rCell

concatif = Mid(concatif, Len(sDelim) + 1)

End Function

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)




Betty wrote:

How do I create this formula in VBA and use this on multiple cells? I've
never worked with this before


--

Dave Peterson

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



All times are GMT +1. The time now is 06:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"