Sheet1
<tbody>
</tbody>
CALCULATIONS
<tbody>
</tbody>
Hi, After searching multiple treads on this I have come up with a partial solution. Excel 2013.
I want to copy the cells consisting of the description, quantity and price to the corresponding columns in 'Sheet1' (which will be named 'PROPOSAL') from the 'CALCULATIONS' sheet. I have used a Macro that I found and tweaked it to move the data to 'Sheet1', however it puts the data in Column A, Row 2 every time...I need it to be placed into the corresponding columns, starting with Column A, Row X and so forth...in 'Sheet1' Columns A,B,C are merged.
Here is my VB code:
Sub BuildProposal()
Dim Src As Worksheet, Dest As Worksheet
Dim n As Integer, i As Integer, c As Integer
Set Src = Sheets("CALCULATIONS")
Set Dest = Sheets("PROPOSAL")
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
.EnableEvents = False
End With
For i = 1 To Src.Range("B" & Rows.Count).End(xlUp).Row
If Src.Range("B" & i).Value <> 0 Then
n = Dest.Range("A" & Rows.Count).End(xlUp).Row + 1
Dest.Range("A" & n).Value = Src.Cells(i, 1).Value
n = Dest.Range("A" & Rows.Count).End(xlUp).Row
Dest.Range("B" & n).Value = Src.Cells(i, 2).Value
n = Dest.Range("A" & Rows.Count).End(xlUp).Row
Dest.Range("C" & n).Value = Src.Cells(i, 3).Value
End If
Next i
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = CalcMode
End With
End Sub
Any help is greatly appreciated.
Thanks!
* | A | B | C | D | E | F |
16 | DESCRIPTION | * | QUANTITY | PRICE | AMOUNT | |
17 | * | * | * | * * * * *- * | ||
18 | * | * | * | * * * * *- * | ||
19 | * | * | * | * * * * *- * | ||
20 | * | * | * | * * * * *- * | ||
21 | * | * | * | * * * * *- * | ||
22 | * | * | * | * * * * *- * | ||
23 | * | * | * | * * * * *- * | ||
24 | * | * | * | * * * * *- * | ||
25 | * | * | * | * * * * *- * | ||
26 | * | * | * | * * * * *- * | ||
27 | * | * | * | * * * * *- * | ||
28 | * | * | * | * * * * *- * | ||
29 | * | * | * | * * * * *- * | ||
30 | * | * | * | * * * * *- * | ||
31 | * | * | * | * * * * *- * | ||
32 | * | * | * | * * * * *- * | ||
33 | * | * | * | * * * * *- * |
<tbody>
</tbody>
CALCULATIONS
* | A | B | C |
4 | Yellow | 12 | 1000 |
5 | White | * | 258 |
6 | Silver | 3 | 59 |
7 | Gold | * | 45 |
8 | Green | 7 | 122 |
9 | Blue | * | 145 |
10 | Red | 3 | 522 |
11 | Purple | 50 | 12 |
<tbody>
</tbody>
Hi, After searching multiple treads on this I have come up with a partial solution. Excel 2013.
I want to copy the cells consisting of the description, quantity and price to the corresponding columns in 'Sheet1' (which will be named 'PROPOSAL') from the 'CALCULATIONS' sheet. I have used a Macro that I found and tweaked it to move the data to 'Sheet1', however it puts the data in Column A, Row 2 every time...I need it to be placed into the corresponding columns, starting with Column A, Row X and so forth...in 'Sheet1' Columns A,B,C are merged.
Here is my VB code:
Sub BuildProposal()
Dim Src As Worksheet, Dest As Worksheet
Dim n As Integer, i As Integer, c As Integer
Set Src = Sheets("CALCULATIONS")
Set Dest = Sheets("PROPOSAL")
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
.EnableEvents = False
End With
For i = 1 To Src.Range("B" & Rows.Count).End(xlUp).Row
If Src.Range("B" & i).Value <> 0 Then
n = Dest.Range("A" & Rows.Count).End(xlUp).Row + 1
Dest.Range("A" & n).Value = Src.Cells(i, 1).Value
n = Dest.Range("A" & Rows.Count).End(xlUp).Row
Dest.Range("B" & n).Value = Src.Cells(i, 2).Value
n = Dest.Range("A" & Rows.Count).End(xlUp).Row
Dest.Range("C" & n).Value = Src.Cells(i, 3).Value
End If
Next i
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = CalcMode
End With
End Sub
Any help is greatly appreciated.
Thanks!