Code to copy text from one sheet to another if the value of a cell is above 0

darrensconfused

New Member
Joined
Apr 21, 2019
Messages
10
Hello Everyone

I am very new to VBA so i am at a loss with this code i have tried copying existing codes from other posts but havent had any luck as yet. The workbook is essentially a price book and i am trying to create a macro that will copy the text from the woksheet "flexible duct" to the "summary" worksheet if the value of F9:F18 is above 0

it would be amazing if the pasted text would autofit into the cells of the summary sheet.

any help would be greatly appreciated as i am at a loss

Thanks

Darren

i have posted a link to my workbook below

https://www.dropbox.com/s/r4m9l4ud9d9gz33/ADA Price Book.xlsm?dl=0
 
Re: Please help! looking for code to copy text from one sheet to another if the value of a cell is above 0

Hello Michael

i would love the data to appear from Row 9 down on the Summary sheet.

Thanks
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Re: Please help! looking for code to copy text from one sheet to another if the value of a cell is above 0

UNTESTED

Code:
Sub MM1()
Dim r As Long, ws As Worksheet, n As Long
n = 9
For Each ws In Worksheets
    If ws.Name <> "ADA" Then
    ws.Activate
        For r = 9 To 18
            If Range("F" & r).Value <> "" Then
                Range("A" & r & ":C" & r).Copy Sheets("Summary").Range("A" & n)
                n = n + 1
            End If
            If Range("Q" & r).Value <> "" Then
                Range("L" & r & ":N" & r).Copy Sheets("Summary").Range("A" & n)
                n = n + 1
            End If
        Next r
    End If
Next ws
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,943
Messages
6,127,826
Members
449,411
Latest member
adunn_23

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