+ Reply to Thread
Results 1 to 4 of 4

Get formula value from each listrow from table

Hybrid View

jaryszek Get formula value from each... 03-11-2020, 06:07 AM
bakerman2 Re: Get formula value from... 03-11-2020, 06:20 AM
jaryszek Re: Get formula value from... 03-11-2020, 06:41 AM
bakerman2 Re: Get formula value from... 03-11-2020, 07:11 AM
  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,949

    Get formula value from each listrow from table

    Hi,

    i am using code to get formula from each row from listobject.
    So in first row i should have "=IF(1=1,0,1)" retrevied.

    Sub test()
    
    Dim irow As ListRow
    
    With ActiveSheet
    For Each irow In .ListObjects(1).ListRows
        
           ''get formula from first column
           Debug.Print irow.Range(1).Formula(1) '' I tried also Debug.Print irow.Range(1).Formula(1,1) but not working
    
    Next irow
    End With
    
    End Sub
    TableExample.xlsm - Example Workbook
    Screenshot_25.png

    How to get formula from this?

    Best,
    Jacek

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,617

    Re: Get formula value from each listrow from table

    This works for me.

    Debug.Print irow.Range(1).Formula
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,949

    Re: Get formula value from each listrow from table

    o wow thank you.

    I was making things harder as usual...

    Jacek

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,617

    Re: Get formula value from each listrow from table

    Glad to help and thanks for rep+.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copying listrow throws an error (copy method of range class failed) why?
    By LIL2606 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-26-2019, 09:32 AM
  2. [SOLVED] Identifying a Listrow's number
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2018, 12:53 PM
  3. Replies: 1
    Last Post: 09-08-2017, 07:30 AM
  4. Deleting Last Table ListRow not firing worksheet change event
    By Tooley in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-24-2017, 12:00 PM
  5. [SOLVED] Adding a row in a table corrupts formula in a summary table (2nd table)
    By How How in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2015, 02:35 PM
  6. Replies: 7
    Last Post: 01-25-2013, 05:17 PM
  7. [SOLVED] Need a formula to sort a table into table (for a Table Plan) and name in column 2
    By jbpianoman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2012, 09:21 AM

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