Results 1 to 10 of 25

Thread: Apply formula Calculation by VBA Value ="to Forumula"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0
    Code:
    Sub calculation()
      Dim wb1 As Workbook, Ws1 As Worksheet, lr1 As Long
      Set wb1 = Workbooks.Open(ThisWorkbook.Path & "\FundsCheck.xlsb")
      Set Ws1 = wb1.Worksheets.Item(1)
      Let lr1 = Ws1.Range("H" & Ws1.Rows.Count).End(xlUp).Row
       Ws1.Range("N2:N" & lr1 & "").Value = "=H2/M2"
       Ws1.Range("N2:N" & lr1 & "").Value = Ws1.Range("N2:N" & lr1 & "").Value
       Ws1.Range("Q2:Q" & lr1 & "").Value = "=N2*P2"
       Ws1.Range("Q2:Q" & lr1 & "").Value = Ws1.Range("Q2:Q" & lr1 & "").Value
       wb1.Save
       wb1.Close
    End Sub
    I used this code and i met with an error this code is if perfect but what this code is doing is suppose coulmn H has data till h20 then this formula is giving the result till n20 and q20 in values but after that also after n20 and q20 also formula is used
    Last edited by DocAElstein; 03-02-2020 at 05:22 PM.

Similar Threads

  1. TAT Calculation
    By pramodagroiya in forum Excel Help
    Replies: 5
    Last Post: 05-30-2016, 12:27 PM
  2. On Going Calculation
    By justme1052 in forum Excel Help
    Replies: 2
    Last Post: 12-31-2013, 02:06 AM
  3. Replies: 5
    Last Post: 10-21-2013, 04:43 PM
  4. Calculation with different condition in a cell
    By LalitPandey87 in forum Excel Help
    Replies: 5
    Last Post: 04-04-2012, 08:38 AM

Tags for this Thread

Posting Permissions

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