Results 1 to 3 of 3

How do you insert a custom function into an excel cell using vba?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    How do you insert a custom function into an excel cell using vba?

    I need to put a formula into a column if the column next to it has a value.

    Application.Worksheets(ws).Range("AC"&LastRow).Formula = "=IF(AB2<>"",("ABC(")&(AB2)&(")ABC(")&(Y2)&(");"), "")"
    although I could use some help with the syntax.

    Basically the final formula should look like

    = "some text" & Cell AB2 & "some text" & Y2 & "some text"

    if AB2 has a value. In the code above I get a end of statement error in VBA which I am guessing is because of all the parentheses.

    If anyone can help me with this I'd appreciate it.
    Last edited by 111StepsAhead; 12-06-2011 at 11:06 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1