PDA

View Full Version : Solved: Copy column "A" to column "Q"



blackie42
10-05-2007, 01:44 AM
How do I automatically copy contents of col A to Col Q as I type an entry in to col A. Can't seem to find anything in column formattinf that will do it. S'pose theres a simple solution.

thanks

Jon

Bob Phillips
10-05-2007, 01:59 AM
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:A" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Copy .Offset(0,16)
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


This is worksheet event code, which means that it needs to be
placed in the appropriate worksheet code module, not a standard
code module. To do this, right-click on the sheet tab, select
the View Code option from the menu, and paste the code in.

blackie42
10-05-2007, 03:51 AM
Thanks - I'll give it a try and let you know later

regards

blackie42
10-05-2007, 05:47 AM
Works a treat - thanks for help

regards