help with EXCEL SCRIPT

N

Nastech

hi, trying to get help on automating copy-paste of data columns. have 4
items to move:
if possible would like double guard: Cell: $DN$6="z", if use of button
to activate/initiate has a pop-up: "Are you Sure": Y/N
if possible: (automatic) adjust of column / cell: $DN$6 locations in
script .. ??, if other items are moved.

specifics on column letters, for (4) moves:
1 col: DU to DT
22 col (main, 21 col back up), COPY: EE - EY,
Paste-Special-Values to right 1 col: EF - EZ
double columns (10 sets of 2), COPY: FE - FV, Paste-Special-Values
to right 2 cols: FG - FX
double columns (1 set of 2), COPY: EC - ED, Paste-Special-Values
to: FE - FF

the following is a copy of the script currently in use. thanks.



Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Target.Row < 130 Then Exit Sub
'add "+" to blank spaces col A:
If Me.Cells(.Row, "A").Value = "." Then Exit Sub
If Not Intersect(Me.Range("a:a"), .Cells) Is Nothing Then
Application.EnableEvents = False
.Value = Replace(.Value, " ", "+")
Application.EnableEvents = True
End If
'make column changes:
If Not Intersect(Me.Range("CK:CO"), .Cells) Is Nothing Then
Application.EnableEvents = False
'Destination:
With Me.Cells(.Row, "CF")
.NumberFormat = "dd"
.Value = Now
End With
Application.EnableEvents = True
End If
'make column changes:
If Not Intersect(Me.Range("CW:CW"), .Cells) Is Nothing Then
Application.EnableEvents = False
'Destination
With Me.Cells(.Row, "CG")
.NumberFormat = "dd"
.Value = Now
End With
Application.EnableEvents = True
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top