Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Copy formating from above row if value is entered

This does not work !

I copied my workbook he

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual to copy format one row down when data entered Jeremy Excel Discussion (Misc queries) 1 November 5th 09 04:20 PM
Copy last data entered into mulitiple sheets within a workbook? Big Al[_2_] Excel Discussion (Misc queries) 2 April 9th 09 04:50 PM
Conditional Formating working when data is entered later ConnieH Excel Worksheet Functions 1 March 19th 07 08:40 PM
Copy formula automatically down when date is entered tommylux Excel Discussion (Misc queries) 15 October 11th 06 04:51 PM
Cannot copy or move array entered formulas ... shared workbk JimDerDog Excel Worksheet Functions 0 May 26th 05 04:17 PM


All times are GMT +1. The time now is 02:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"