![]() |
Colors in Cells....
Hi There!
Thank you in advanced for taking the time to read this. We have some files that have to be colorful, long story short.... How can we COPY a cell? I mean copy the value and the color of it. We know there is some VB code to get the color number of a cell. But, how do we tell that cell to get the format or color and the value, not just the value. Any help or tips are highly appreciated!! Best Regards. |
Colors in Cells....
Mario,
You can use the Copy method. E.g., Range("A1").Copy destination:=Range("D5") -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Mario Manzano" wrote in message ... Hi There! Thank you in advanced for taking the time to read this. We have some files that have to be colorful, long story short.... How can we COPY a cell? I mean copy the value and the color of it. We know there is some VB code to get the color number of a cell. But, how do we tell that cell to get the format or color and the value, not just the value. Any help or tips are highly appreciated!! Best Regards. |
Colors in Cells....
Hi Mario,
Mario Manzano wrote: Thank you in advanced for taking the time to read this. We have some files that have to be colorful, long story short.... How can we COPY a cell? I mean copy the value and the color of it. We know there is some VB code to get the color number of a cell. But, how do we tell that cell to get the format or color and the value, not just the value. Any help or tips are highly appreciated!! here are two possibilities: Range("A1").Copy Range("C10") ---- Dim rngSource As Range Dim rngTarget As Range Set rngSource = Range("A1") Set rngTarget = Range("D1") With rngTarget .Value = rngSource.Value .Interior.ColorIndex = rngSource.Interior.ColorIndex .Font.Color = rngSource.Font.Color End With -- Regards Melanie Breden - Microsoft MVP für Excel - http://excel.codebooks.de (Das Excel-VBA Codebook) |
Colors in Cells....
Thank you !! very, very
much!! -----Original Message----- Mario, You can use the Copy method. E.g., Range("A1").Copy destination:=Range("D5") -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Mario Manzano" wrote in message ... Hi There! Thank you in advanced for taking the time to read this. We have some files that have to be colorful, long story short.... How can we COPY a cell? I mean copy the value and the color of it. We know there is some VB code to get the color number of a cell. But, how do we tell that cell to get the format or color and the value, not just the value. Any help or tips are highly appreciated!! Best Regards. . |
Colors in Cells....
Melanie,
Thank you for your kindness!! -----Original Message----- Hi Mario, Mario Manzano wrote: Thank you in advanced for taking the time to read this. We have some files that have to be colorful, long story short.... How can we COPY a cell? I mean copy the value and the color of it. We know there is some VB code to get the color number of a cell. But, how do we tell that cell to get the format or color and the value, not just the value. Any help or tips are highly appreciated!! here are two possibilities: Range("A1").Copy Range("C10") ---- Dim rngSource As Range Dim rngTarget As Range Set rngSource = Range("A1") Set rngTarget = Range("D1") With rngTarget .Value = rngSource.Value .Interior.ColorIndex = rngSource.Interior.ColorIndex .Font.Color = rngSource.Font.Color End With -- Regards Melanie Breden - Microsoft MVP für Excel - http://excel.codebooks.de (Das Excel-VBA Codebook) . |
All times are GMT +1. The time now is 08:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com