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

Hi all
I was trying to create a function to emulate the CONCATENATE function so as
not to have fill in every time I need it.
This is the code I have so far
Function InvFileName()
firstfield = 0
secondfield = ActiveCell.Offset(0, -2).Value
thirdfield = " "
fourthfield = ActiveCell.Offset(0, -5).Value
fifthfield = " - "
sixthfield = ActiveCell.Offset(0, -6).Value
InvFileName = CONCATENATE(firstfield, secondfield, thirdfield, fourthfield,
fifthfield, sixthfield)

Please advise what I need to do to tweek this to make it work.

Thanks for any and all help!
--
Have a great day and a better tomorrow!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Creating function

One way:

Function InvFileName()
firstfield = 0
secondfield = ActiveCell.Offset(0, -2).Value
thirdfield = " "
fourthfield = ActiveCell.Offset(0, -5).Value
fifthfield = " - "
sixthfield = ActiveCell.Offset(0, -6).Value
InvFileName = firstfield & secondfield & thirdfield & _
fourthfield & fifthfield & sixthfield
End Function

or just

Function InvFileName()
InvFileName = 0 & _
ActiveCell.Offset(0, -2).Value & _
" " & _
ActiveCell.Offset(0, -5).Value & _
" - " & _
ActiveCell.Offset(0, -6).Value
End Function

Regards

Trevor


"gjmink" wrote in message
...
Hi all
I was trying to create a function to emulate the CONCATENATE function so
as
not to have fill in every time I need it.
This is the code I have so far
Function InvFileName()
firstfield = 0
secondfield = ActiveCell.Offset(0, -2).Value
thirdfield = " "
fourthfield = ActiveCell.Offset(0, -5).Value
fifthfield = " - "
sixthfield = ActiveCell.Offset(0, -6).Value
InvFileName = CONCATENATE(firstfield, secondfield, thirdfield,
fourthfield,
fifthfield, sixthfield)

Please advise what I need to do to tweek this to make it work.

Thanks for any and all help!
--
Have a great day and a better tomorrow!



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
Help with creating a function Craig Excel Worksheet Functions 4 February 2nd 09 09:51 PM
Need help creating a function chrspty Excel Worksheet Functions 2 August 1st 08 04:48 PM
Need help creating a function nander Excel Discussion (Misc queries) 3 February 20th 06 04:57 AM
Creating a Sub Function No Name Excel Programming 2 May 18th 04 08:46 PM
Creating a function Todd Huttenstine[_2_] Excel Programming 15 December 5th 03 11:38 PM


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