Results 1 to 6 of 6

Alternative to using INDIRECT for dynamic references to other sheets

Threaded View

  1. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Alternative to using INDIRECT for dynamic references to other sheets

    Here is the work sheet event . When B column value is changed ,in the same row all formulas are changed automatically. Indirect not required. Hence problem will not be there.
    In the initial stage to change all rows formulas. Cut the range say B10:B100. Paste the same in different column. Column B is blank now . Now paste back the data to B column. All rows formulas are now changed.
    Code :
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Range("B10:B100"), Target) Is Nothing Then
    
    Dim cel As Range
    Dim val
    Dim Ro As Long
    
    Application.EnableEvents = False
    Application.DisplayAlerts = False
    
    For Each cel In Target
    If cel <> "" Then
    val = cel.Value
    Ro = cel.Row
    Cells(Ro, "C").Formula = "=IFERROR('" & val & "'!B5,"""")"
    Cells(Ro, "D").Formula = "=IFERROR('" & val & "'!B15,"""")"
    Cells(Ro, "E").Formula = "=IFERROR('" & val & "'!B12,"""")"
    Cells(Ro, "F").Formula = "=IFERROR('" & val & "'!Z2,"""")"
    Cells(Ro, "G").Formula = "=IFERROR('" & val & "'!W1,"""")"
    End If
    Next cel
    Application.EnableEvents = True
    Application.DisplayAlerts = True
    
    End If
    End Sub
    Worksheetevent

    To paste the code
    Right click on Sheet tab --> view code
    Visual Basic (VB) window opens.
    Paste the code
    Close the VB window.
    Save the file
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 06-11-2021 at 07:36 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Index match formula from sales data worksheet to receivable worksheet
    By sunboy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-27-2020, 02:55 PM
  2. Replies: 7
    Last Post: 10-03-2019, 11:23 AM
  3. [SOLVED] Index Match formula for dashboard worksheet
    By SurfexcelIT in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-24-2016, 03:50 AM
  4. Replies: 3
    Last Post: 02-21-2014, 10:02 AM
  5. Error in Index & Match Formula due to Defined Names Worksheet is Getting Changed!
    By Rajeshkumar R in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-11-2013, 08:37 AM
  6. Replies: 3
    Last Post: 05-02-2013, 01:31 AM
  7. Replies: 2
    Last Post: 01-13-2012, 05:21 PM

Tags for this Thread

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