+ Reply to Thread
Results 1 to 2 of 2

Setting a cell's value as a formula containing quotes or double quotes using vba

  1. #1
    Registered User
    Join Date
    10-08-2006
    Posts
    1

    Setting a cell's value as a formula containing quotes or double quotes using vba

    I am having a problem doing this. When I use the following statement:

    Please Login or Register  to view this content.
    I get an error. The obvious reason, to me anyways, is that ths is caused by the usage of quotes in the formula and the way VBA handles said quotes. Is there a way to assign that cell the formula using vba and have said formula contain the quotes required?

    Thanks again!

  2. #2
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    Try this

    Sheet4.Cells(Target.Row, 3).Value = "=IF(OR(C8=" & """" & ",C8<17,F8=" & """")," & """" & ",VLOOKUP(F8,'APFT Male Tables'!A4:K77,IF(C8>61,11,ROUNDUP((C8-16)/5+1,0)),TRUE))"

    For each " you need another " so if you want "" you have to have """"

+ Reply to Thread

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