S sliderxb New Member Oct 3, 2012 #1 example in cell a1 on worksheet 1 i have a red background and text cell a2 yellow background and text etc etc is there a macro, formula, vb script that anyone knows to do this thanks
example in cell a1 on worksheet 1 i have a red background and text cell a2 yellow background and text etc etc is there a macro, formula, vb script that anyone knows to do this thanks
Luke M Excel Ninja Staff member Oct 3, 2012 #2 A formula can't do it, but the VB script is simple enough. Works by using this syntax RangeToCopy.Copy Destination Example: Code: Worksheets("Sheet1").Range("A1:A2").Copy Worksheets("Sheet2").Range("A1") this would copy cells A1:a2 from Sheet1 to Sheet2. This type of copying copies cell contents and formatting (including color). PS. Not sure if you noticed, but your website in your profile is missing a "w" at the beginning. =)
A formula can't do it, but the VB script is simple enough. Works by using this syntax RangeToCopy.Copy Destination Example: Code: Worksheets("Sheet1").Range("A1:A2").Copy Worksheets("Sheet2").Range("A1") this would copy cells A1:a2 from Sheet1 to Sheet2. This type of copying copies cell contents and formatting (including color). PS. Not sure if you noticed, but your website in your profile is missing a "w" at the beginning. =)
S sliderxb New Member Oct 3, 2012 #3 thanks for this, however im getting an error .range any ideas why?
SirJB7 Excel Rōnin Oct 3, 2012 #4 Hi, sliderxb! Check this points: - exists source worksheet "Sheet1"? - exists target worksheet "Sheet2"? - range A1:A2 in target worksheet is protected? - target worksheet has change event procedure? If not or if not sure, consider uploading the sample file better than posting the whole procedure code. Regards!
Hi, sliderxb! Check this points: - exists source worksheet "Sheet1"? - exists target worksheet "Sheet2"? - range A1:A2 in target worksheet is protected? - target worksheet has change event procedure? If not or if not sure, consider uploading the sample file better than posting the whole procedure code. Regards!