Hello, please keep it simple, i am a complete noob

i would like to have a function that works something like this


{name of the function} ( {adress of a cell containing a color i want to use} ) {cells that will be colored}

simply put, the function copies a backround color of one cell to selected cells no matter what the values of those cells are

i would use this function to see the shift of different people (colors) on a time table.
i could use for example an IF function to color a certain range when i write pick a 1 hour shift, and i could color a bigger range when i pick a 2 hour shift


It seems that changing the backround color is complicated but it would work if i could at least change the bordest with the same logic.. something like

{name of the function} ( {adress of a cell containing a color i want to use} {adress containing thickness of borders ) {cells that will be colored}


-------------------------------------------------------------------------

here is what i have got so far


This changes the color of a cell defined by user - but only to a color predefined in the code, all i would need (i think) is to somehow be able to define that color by a cell (either color of the cell or numbers, i could make it work but id prefer the color directly to be read from a pre-colored cell > it should be possible to change and update all the colors)

-----------------------------
Function SetIt(RefCell)

RefCell.Parent.Evaluate "getRGB(" & RefCell.Address(False, False) & ")"
SetIt = ""
End Function

Sub getRGB(RefCell As Range)
RefCell.Interior.Color = 123456 ***this is the color number, i would like to be able to change
End Sub

-----------------------------

I found this online and it works very well but i cant define the color - i tried putting the numers of rgb there as variables R G and B, that didnt work, i dont really have any idea how to put variables in there.. "noob" id rpefer it to read the color directly anyway..
i also found a piece of code that takes a cells color and writed down its RGB value, but i cant put them together due to lack of my skill

Thanks in advance for the help