Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

copy one cell data from multiple sheet to master sheet

I know there is a code for copy data from cell to cell given the Origen is there a better way to copy the same cell from multiple sheets & skipping the master sheet Like sheet2 cell A1(april), sheet3 cell "A1"(Johny), Sheet4 cell "A1"(May) and go on to the next multiple sheets like that and past them in the master sheet

Sub Copy_Example()

  Range("A1").Copy Destination:=Range("B3")

End Sub

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Sub macro1()

   Dim wb As Workbook, ws As Worksheet, ar, i As Long
   
   Set wb = ThisWorkbook
   ReDim ar(1 To wb.Sheets.Count - 1, 1 To 1)
   
   i = 0
   For Each ws In wb.Sheets
        If LCase(ws.Name) <> "master" Then
            i = i + 1
            ar(i, 1) = ws.Range("A1").Value2
        End If
   Next
   
   wb.Sheets("master").Range("A1").Resize(UBound(ar)) = ar

End Sub
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading