PC Review


Reply
Thread Tools Rate Thread

Creating function

 
 
=?Utf-8?B?Z2ptaW5r?=
Guest
Posts: n/a
 
      14th Aug 2007
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 With Quote
 
 
 
 
Trevor Shuttleworth
Guest
Posts: n/a
 
      14th Aug 2007
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" <(E-Mail Removed)> wrote in message
news:76C14D42-2AD4-486C-8845-(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Help creating function(s) strive4peace Microsoft Access 1 16th Jan 2009 10:14 PM
Creating a function David Microsoft ASP .NET 3 5th Apr 2007 05:30 PM
Help creating a function Gary Kahrau Microsoft VB .NET 19 18th Aug 2005 04:05 PM
Creating a Macros function but co9ntent of function only works in a sub plz help Alexandre Brisebois (www.pointnetsolutions.com) Microsoft Excel Discussion 6 20th Jul 2005 06:26 PM
Creating a function Todd Huttenstine Microsoft Excel Programming 15 5th Dec 2003 11:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:50 PM.