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?
 

Adam_98

New Member
Joined
Sep 17, 2021
Messages
18
Office Version
  1. 365
Platform
  1. Windows
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
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

faraz502

Board Regular
Joined
Mar 26, 2014
Messages
98
Office Version
  1. 2016
Platform
  1. Windows
Apologies I thought I attached this earlier
Dear, you follow the step on?

Because the VBA code not found the "Spread Data" If you added the sheet please check the spelling.

1631960755720.png
 

Adam_98

New Member
Joined
Sep 17, 2021
Messages
18
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

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.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
60,139
Office Version
  1. 365
Platform
  1. Windows
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.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
60,139
Office Version
  1. 365
Platform
  1. Windows
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.
 

vcoolio

Well-known Member
Joined
Jun 29, 2014
Messages
1,204
Office Version
  1. 365
Platform
  1. Windows
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.
 

Adam_98

New Member
Joined
Sep 17, 2021
Messages
18
Office Version
  1. 365
Platform
  1. Windows
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
 

Forum statistics

Threads
1,148,277
Messages
5,745,813
Members
423,980
Latest member
zimza

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
Top