Adding cells from different sheets to another sheet by the sheet name.

Filipzgela

New Member
Joined
Nov 20, 2024
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
The title is probably confusing, but the question is quite simple.
I have a bunch of sheets that have people's data in them. Now i would like to make a new "Master" sheet where in the first row i would have names of the people (which would be equal to sheets names). In the first column i would have some data that will be used in the code so i can add data from the sheets with some conditions. I saw this thread:
but i cannot make this work if the "country names" from the thread are in row 1 instead of column A
Thank you in advance
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
I found a solution:

VBA Code:
Sub Filipzgela()
   Dim Cl As Range
   Dim Ws As Worksheet
  
   Set Ws = Worksheets("Master")
   For Each Cl In Ws.Range("A1", Ws.Cells(1, Columns.Count).End(xlToLeft))
      If Evaluate("isref('" & Cl.Value & "'!A1)") Then
         With Worksheets(Cl.Value)
          ...functions you need
         End With
      End If
   Next Cl
End Sub

Someone answered that question, but deleted the comment so i am reposting it
 
Last edited by a moderator:
Upvote 0
Solution

Forum statistics

Threads
1,224,259
Messages
6,177,482
Members
452,782
Latest member
ZCapitao

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top