Hi,
I have an excel workbook with multiple worksheets that are exported from a different folder. I have created a sheet called "DestinationSheet" to display the outputs then "NewSheet" where all my command buttons are. I want to do the some adjustments to the following VBA codes that were already run through macro. I need the columns C and D corresponding to each exactly in the B columns.
Following the VBA code for each column C and D that are needed to adjust
Figure1:
1)
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> "DestinationSheet" Then
ws.Range("C14").Copy Sheets("DestinationSheet").Cells(Rows.Count, "B").End(xlUp).Offset(1)
End If
Next
Application.ScreenUpdating = True
End Sub
This is for column B as shown in the screenshot. I need to bring it down 3 rows from the top.
2) Sub NonCashField()
'(SUM('Sheet1'!D23:Q23) > 0
With Worksheets("DestinationSheet")
For i = 1 To Worksheets.Count
nm = Worksheets(i).Name
.Range(.Cells(i + 1, 3), .Cells(i + 1, 3)).Formula = "=SUM('" & nm & "'!D23:q23) > 0"
Next i
End With
End Sub
This is for column C. I need to bring it down 3 rows from the top.
3)
Dim sh As Worksheet, shd As Worksheet
Dim i As Long
i = 2
Set shd = Sheets("DestinationSheet")
For Each sh In Sheets
If sh.Name <> shd.Name Then
If sh.Range("Q13").Value = "2" And sh.Range("Q15").Value = "2" Then
shd.Range("D" & i).Value = "Not met"
Else
shd.Range("D" & i).Value = "Met"
End If
i = i + 1
End If
Next
End Sub
This is for the output for column D as shown screenshot. It needs to bring output from 3 rows down from the top
The final output should be like this:
Figure2:
When I ran the Macro, it grabs the values from "NewSheet" and "DestinationSheet". I want to grab the values from other sheets excluding the "NewSheet" and "DestinationSheet" in the
I would really appreciate it if you could help me fix for each columns and should be similar to the one in Figure 2
I have an excel workbook with multiple worksheets that are exported from a different folder. I have created a sheet called "DestinationSheet" to display the outputs then "NewSheet" where all my command buttons are. I want to do the some adjustments to the following VBA codes that were already run through macro. I need the columns C and D corresponding to each exactly in the B columns.
Following the VBA code for each column C and D that are needed to adjust
Figure1:
1)
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> "DestinationSheet" Then
ws.Range("C14").Copy Sheets("DestinationSheet").Cells(Rows.Count, "B").End(xlUp).Offset(1)
End If
Next
Application.ScreenUpdating = True
End Sub
This is for column B as shown in the screenshot. I need to bring it down 3 rows from the top.
2) Sub NonCashField()
'(SUM('Sheet1'!D23:Q23) > 0
With Worksheets("DestinationSheet")
For i = 1 To Worksheets.Count
nm = Worksheets(i).Name
.Range(.Cells(i + 1, 3), .Cells(i + 1, 3)).Formula = "=SUM('" & nm & "'!D23:q23) > 0"
Next i
End With
End Sub
This is for column C. I need to bring it down 3 rows from the top.
3)
Dim sh As Worksheet, shd As Worksheet
Dim i As Long
i = 2
Set shd = Sheets("DestinationSheet")
For Each sh In Sheets
If sh.Name <> shd.Name Then
If sh.Range("Q13").Value = "2" And sh.Range("Q15").Value = "2" Then
shd.Range("D" & i).Value = "Not met"
Else
shd.Range("D" & i).Value = "Met"
End If
i = i + 1
End If
Next
End Sub
This is for the output for column D as shown screenshot. It needs to bring output from 3 rows down from the top
The final output should be like this:
Figure2:
When I ran the Macro, it grabs the values from "NewSheet" and "DestinationSheet". I want to grab the values from other sheets excluding the "NewSheet" and "DestinationSheet" in the
I would really appreciate it if you could help me fix for each columns and should be similar to the one in Figure 2