Combine data from Multiple Sheets with Formulas and Images

Gannas_CI

New Member
Joined
Apr 6, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi I have been able to muddle my way through multiple issues using your threads however have come to one that I cannot overcome.

Using a combine VBA found here, I successfully included data from all of my worksheets.

The issue arises that one column in the copied row has a formula that I want to paste as text and another column is a picture.

VBA Code:
Sub Combine()

Dim startRow, startCol, lastRow, lastCol As Long
Dim headers As Range

'Set Master sheet for consolidation
Set mtr = Worksheets("Combined")

'loop through all sheets
For Each Ws In ActiveWorkbook.Worksheets
     'except the master sheet from looping
     If Ws.Name <> "Index" And Ws.Name <> "New Location" And Ws.Name <> "Combined" Then
        Ws.Activate
        Ws.Unprotect
        lastRow = Cells(Rows.Count, 1).End(xlUp).Row
        lastCol = Cells(12, Columns.Count).End(xlToLeft).Column + 6
        'get data from each worksheet and copy it into Combined sheet
        Range(Cells(13, 1), Cells(lastRow, lastCol)).Copy _
        mtr.Range("A" & mtr.Cells(Rows.Count, 1).End(xlUp).Row + 1)
        Ws.Protect
           End If
Next Ws
          
Worksheets("Combined").Activate

End Sub

The formula I want to have the text only result is in merged columns 'V:AB' and the images are in merged column 'AX:BD'

Further to this at the end of each row copied I want the tab name as a reference added to column 'BE'.

I am not sure if this is even possible in the one or if I should try to have a separate lookup match VBA. I tried to write one of those but got a little confused.

Hoping someone can help.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,224,836
Messages
6,181,248
Members
453,026
Latest member
cknader

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