Check more Sheets but keep format

pantakos

Board Regular
Joined
Oct 10, 2012
Messages
158
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Can you please help me.

If I want to check another column at the same sheet (and all other sheets in the array) what can I do?

I tried to change sht = Array("E") to sht = Array("E", "K") in order to check both Columns and add it where the code paste the values, but no luck.

I need to keep the table.

What can I do?



Thank you in advance,

Gerasimos



SAMPLE5.xlsm



PS: Question have been posted here https://www.excelforum.com/exc…-problem.html#post5658628 and Check more Sheets but keep format - OzGrid Free Excel/VBA Help Forum
 
@mumps hello again.

Is it possible the drop down menu to work with search? Like google, when type then make suggestions.

Here is the code

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("D:D")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Dim bottomC As Long
    bottomC = Sheets("DATA").Range("C" & Rows.Count).End(xlUp).Row
    Dim x As Long
    For x = bottomC To 2 Step -1
        If Sheets("DATA").Cells(x, 1) = Target Then
            Sheets("DATA").Cells(x, 3).Copy Cells(Target.Row + 4, Target.Row) 
           Sheets("DATA").Cells(x, 4).Copy Cells(Target.Row + 5, Target.Row)
            Sheets("DATA").Cells(x, 5).Copy Cells(Target.Row + 2, Target.Row) 
            Sheets("DATA").Cells(x, 6).Copy Cells(Target.Row + 3, Target.Row)
           Sheets("DATA").Cells(x, 10).Copy Cells(Target.Row + 6, Target.Row)
           Sheets("DATA").Cells(x, 9).Copy Cells(Target.Row + 7, Target.Row)
           Sheets("DATA").Cells(x, 14).Copy Cells(Target.Row + 1, Target.Row)
        End If
    Next x
    Application.ScreenUpdating = True
End Sub

The sample file is the same as above.

Thank you one more time.
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Please note that since this is a different request, you should start a new thread,
 
Upvote 0
@mumps yes I know, but I cant delete my last post. I will create a new one. Thank you!
 
Upvote 0
@mumps Hello Again, since you are that helped me a lot to make the code working can you please help me one more time? I am following this post because the code is the same, sligtly changed
What I need is to rename the created sheet (Products) with the name of the sheets in ws , that are filled with data.

VBA Code:
Sub BuildTemplateINm()
    Application.ScreenUpdating = False
    Dim Ws As Worksheet, desWS As Worksheet, rng As Range, lRow As Long
    Const sPw As String = "********"
    Dim oWs As Worksheet
    Dim wb As Workbook: Set wb = ThisWorkbook
    For Each oWs In ThisWorkbook.Worksheets
        oWs.Unprotect sPw
    Next oWs
    If Not Evaluate("isref('" & "Products" & "'!A1)") Then
        Set desWS = Sheets.Add(after:=Sheets(Sheets.Count))
       
        With ActiveSheet
            .Name = "Products"
            .Range("A1").Resize(, 2).Value = Array("Description", "Quantity")
        End With
    Else
       Sheets("Products").UsedRange.Offset(1).ClearContents
       Set desWS = Sheets("Products")
    End If
    For Each Ws In Sheets
        If Ws.Name <> "PROFORMA" And Ws.Name <> "ORDER LIST" And Ws.Name <> "PRODUCTS" And Ws.Name <> "DATASET" And Ws.Name <> "TOTAL OFFER" And Ws.Name <> "DATA" Then
            With Ws
                If .Range("H" & .Rows.Count).End(xlUp).Row > 12 Then
                      For Each rng In .Range("H14", .Range("H" & .Rows.Count).End(xlUp))
                        If (IsNumeric(rng.Value)) And (rng.Value <> 0) Then
                           With desWS
                                .Cells(.Rows.Count, "A").End(xlUp).Offset(1).Resize(, 2).Value = Array(rng.Offset(, -6), rng)
                            End With
                        End If
                    Next rng
                End If
                If .Range("O" & .Rows.Count).End(xlUp).Row > 12 Then
                    For Each rng In .Range("O14", .Range("O" & .Rows.Count).End(xlUp))
                        If (IsNumeric(rng.Value)) And (rng.Value <> 0) Then
                            With desWS
                                .Cells(.Rows.Count, "A").End(xlUp).Offset(1).Resize(, 2).Value = Array(rng.Offset(, -6), rng)
                            End With
                        End If
                    Next rng
                End If
            End With
        End If
    Next Ws
    Sheets("Products").Columns.AutoFit
    Application.ScreenUpdating = True
    For Each oWs In ThisWorkbook.Worksheets
        oWs.Protect sPw
    Next oWs
End Sub

If this cant be answered here I will create a new thread, I dont want to full the forum with new threads

Thank you !
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,856
Members
449,194
Latest member
HellScout

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