If row is green copy all date to another row

Adam_98

New Member
Joined
Sep 17, 2021
Messages
18
Office Version
  1. 365
Platform
  1. Windows
I'm quite new to Excel and I'm trying to create a document to help me for work. I have a main sheet where all my data is inputted into. The rows in this data will be Green, Amber or red depending on the status. What my goal is, when a row is green, it copies the data from one sheet to another. Is there any way to do this and is any further information needed?
 
Firstly I would like to thank you for the support on this. I've followed the Instructions above and it's retrieving this message. Any ideas?

1631914607579.png


1631914695971.png
 
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.
I thought this might be the case however after checking the spelling was the same as the one in the code. I can attach the document again if needed with the additional tabs included.
 
Upvote 0
I thought this might be the case however after checking the spelling was the same as the one in the code. I can attach the document again if needed with the additional tabs included.
That might not be a bad idea.

Also, make sure that there are no extra spaces in your sheet tab names. Something as simple as that could cause them not to match up.
 
Upvote 0
Just as I suspected (and mentioned in my previous post)...

If you double-click on the sheet tab name to edit it, you will see an extra space after the name "Spread Data ".
Get rid of the extra space.
 
Upvote 0
Hello Adam,

Just my two cents worth. Try the following trimmed down code assigned to the short cut key mentioned in an earlier post:-

VBA Code:
Option Explicit
Sub Test()

        Dim wsQ As Worksheet: Set wsQ = Sheets("quotes")
        Dim wsSD As Worksheet: Set wsSD = Sheets("Spread Data")

Application.ScreenUpdating = True

        With wsQ.Range("A4", wsQ.Range("A" & wsQ.Rows.Count).End(xlUp))
                .AutoFilter 1, RGB(0, 176, 80), 8
                .Offset(1).Resize(, 27).Copy wsSD.Range("A" & Rows.Count).End(3)(2)
                '.Offset(1).Resize(, 27).EntireRow.Delete
                .AutoFilter
        End With

Application.ScreenUpdating = True

End Sub

Take heed of Joe's last post and the above should work for you.
The code also has a delete line of code included in case you want to delete the relevant rows from the 'quotes' sheet once a data transfer has been completed. It's in green font. To active this line of code, just remove the apostrophe from in front of it.

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
Just as I suspected (and mentioned in my previous post)...

If you double-click on the sheet tab name to edit it, you will see an extra space after the name "Spread Data ".
Get rid of the extra space.
Hey Joe,

Thanks for reviewing and spotting the Error. It's working now. Just new into coding but didn't even think something that small would impact the code so much. I'm testing these changes now to see if they will work. Will keep you guys updated but thank you verymuch for the help :)

Thanks,

Adam
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,184
Members
448,949
Latest member
keycalinc

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