+ Reply to Thread
Results 1 to 2 of 2

VBA Code: Help to Use a Formula which needs to be pasted in a cell

  1. #1
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    VBA Code: Help to Use a Formula which needs to be pasted in a cell

    hi,

    in A1 i have date and i would need value of B1 to be Weeknumber of A1 and i use a variable to refer to the cell ( i think there is a problem with the Syntax)

    Please Login or Register  to view this content.
    both gives me error ( also what is the primary difference between using ".formula" and ".value")

    Thanks.
    Last edited by vidyuthrajesh; 03-07-2012 at 08:16 AM. Reason: Resolved:Thanks

  2. #2
    Registered User
    Join Date
    03-07-2012
    Location
    Russia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: VBA Code: Help to Use a Formula which needs to be pasted in a cell

    You can insert formula:
    Range("B1").Formula = "=WEEKNUM(A" & i & ")"

    or result of formula:
    Range("B1").Value = Evaluate("WEEKNUM(a" & i & ")")
    Last edited by DrVoid; 03-07-2012 at 08:07 AM.

+ 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