+ Reply to Thread
Results 1 to 3 of 3

Copy formating from above row if value is entered

  1. #1
    Mikus
    Guest

    Copy formating from above row if value is entered

    How do i copy cell's formating in column B from column B 1 row above if any
    value is entered into same row's cell in column A

    For example if i enter any value in cell A7 then formating (including
    conditional formating) of Cell B6 should be copied to cell B7

  2. #2
    Peter T
    Guest

    Re: Copy formating from above row if value is entered

    Try this in the Sheet module (right-click sheet-tab, view code)

    Private Sub Worksheet_Change(ByVal Target As Range)
    On Error GoTo errH
    If Not Intersect(Range("A2:A65536"), Target(1)) Is Nothing Then
    Application.EnableEvents = False

    With Target(1)
    .Offset(-1, 1).Copy
    .Offset(0, 1).PasteSpecial Paste:=xlFormats
    .Select
    End With

    End If
    errH:
    Application.CutCopyMode = False
    Application.EnableEvents = True
    End Sub

    Regards,
    Peter T

    "Mikus" <Mikus@discussions.microsoft.com> wrote in message
    news:6D3669CF-3060-4975-8F7F-8DB655878DF2@microsoft.com...
    > How do i copy cell's formating in column B from column B 1 row above if

    any
    > value is entered into same row's cell in column A
    >
    > For example if i enter any value in cell A7 then formating (including
    > conditional formating) of Cell B6 should be copied to cell B7




  3. #3
    Mikus
    Guest

    Re: Copy formating from above row if value is entered

    This does not work !

    I copied my workbook here:

    www.svara-kontrole.lv/Job_queue.xls

    Can anyone debug this... why does this is not working ?

    Example from job_queue.xls - i want to copy formating from B16 To B17 if A17
    contains value.

    Note A17 contains Formula, but it should not be treated as value ... i want
    this to triger if there real value in A17 !

    "Peter T" wrote:

    > Try this in the Sheet module (right-click sheet-tab, view code)
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > On Error GoTo errH
    > If Not Intersect(Range("A2:A65536"), Target(1)) Is Nothing Then
    > Application.EnableEvents = False
    >
    > With Target(1)
    > .Offset(-1, 1).Copy
    > .Offset(0, 1).PasteSpecial Paste:=xlFormats
    > .Select
    > End With
    >
    > End If
    > errH:
    > Application.CutCopyMode = False
    > Application.EnableEvents = True
    > End Sub
    >
    > Regards,
    > Peter T
    >
    > "Mikus" <Mikus@discussions.microsoft.com> wrote in message
    > news:6D3669CF-3060-4975-8F7F-8DB655878DF2@microsoft.com...
    > > How do i copy cell's formating in column B from column B 1 row above if

    > any
    > > value is entered into same row's cell in column A
    > >
    > > For example if i enter any value in cell A7 then formating (including
    > > conditional formating) of Cell B6 should be copied to cell B7

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1