Consulting

Results 1 to 3 of 3

Thread: How to copy an entire row from 1 sheet to another

  1. #1
    VBAX Regular
    Joined
    Jan 2018
    Posts
    7
    Location

    How to copy an entire row from 1 sheet to another

    Hi,

    I need help.

    How can I copy everything (color, font, etc) from one sheet to another.

    Ex. (File attach)

    If I copy "Title Guide" C5 to "Schedule" C10.
    I want "Schedule" A10, B10, D10, E10, F10, G10 and H10 to have the same color and font from "Schedule" C10

    "Schedule" A18, B18, D18, E18, F18, G18 and H18 to have the same color and font from "Schedule" C18 and so on.


    Problem is "Schedule" already have formula in it cells.

    I try to use this VBA and it works for me but I cant do it till like "A500:H500" because it says "Compile error: Procedure too large"

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Range("A1:H1").Interior.Color = Range("C1").Interior.Color
    Range("A1:H1").Font.Color = Range("C1").Font.Color
    Range("A2:H2").Interior.Color = Range("C2").Interior.Color
    Range("A2:H2").Font.Color = Range("C2").Font.Color
    Range("A3:H3").Interior.Color = Range("C3").Interior.Color
    Range("A3:H3").Font.Color = Range("C3").Font.Color
    Range("A4:H4").Interior.Color = Range("C4").Interior.Color
    Range("A4:H4").Font.Color = Range("C4").Font.Color
    Range("A5:H5").Interior.Color = Range("C5").Interior.Color
    Range("A5:H5").Font.Color = Range("C5").Font.Color
    Range("A6:H6").Interior.Color = Range("C6").Interior.Color
    Range("A6:H6").Font.Color = Range("C6").Font.Color
    Range("A7:H7").Interior.Color = Range("C7").Interior.Color
    Range("A7:H7").Font.Color = Range("C7").Font.Color
    Range("A8:H8").Interior.Color = Range("C8").Interior.Color
    Range("A8:H8").Font.Color = Range("C8").Font.Color
    Range("A9:H9").Interior.Color = Range("C9").Interior.Color
    Range("A9:H9").Font.Color = Range("C9").Font.Color
    Range("A10:H10").Interior.Color = Range("C10").Interior.Color
    Range("A10:H10").Font.Color = Range("C10").Font.Color
    End Sub
    Attached Files Attached Files
    Last edited by Rashidz; 04-23-2019 at 03:16 AM.

  2. #2

  3. #3
    VBAX Regular
    Joined
    Jan 2018
    Posts
    7
    Location
    I post it here because I cant attach a file on the other site.

    I guess I should delete the post there

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •