Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88809

Assign value without formatting

$
0
0

I'm looping through workbooks to aggregate the data to one sheet. The data on the various source sheets is always in the same columns but the rows will vary.

I'm assigning values but conditional formatting is coming through.

Screen updating is off.

How can I copy values from one book to another?

For Each sheet In Workbooks(filename).Worksheets
    If sheet.Name = "Template" Then
        lastrow = sheet.Range("A"& Rows.Count).End(xlUp).row
        For row = 2 To lastrow
            All.Range("A"& All_nextrow).Value = sheet.Range("A"& row).Value
            All.Range("B"& All_nextrow).Value = sheet.Range("B"& row).Value
            All.Range("C"& All_nextrow).Value = sheet.Range("C"& row).Value
            All.Range("D"& All_nextrow).Value = sheet.Range("D"& row).Value
            All.Range("E"& All_nextrow).Value = sheet.Range("E"& row).Value
            All.Range("F"& All_nextrow).Value = sheet.Range("F"& row).Value
            All.Range("G"& All_nextrow).Value = sheet.Range("G"& row).Value
            All.Range("H"& All_nextrow).Value = sheet.Range("H"& row).Value
            All.Range("I"& All_nextrow).Value = sheet.Range("I"& row).Value
            All.Range("J"& All_nextrow).Value = sheet.Range("J"& row).Value
            All.Range("K"& All_nextrow).Value = sheet.Range("K"& row).Value
            All.Range("L"& All_nextrow).Value = Workbooks(filename).Name
            All_nextrow = All_nextrow + 1
        Next row
    End If
Next sheet

Viewing all articles
Browse latest Browse all 88809

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>