A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro Help



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2010, 04:20 PM posted to microsoft.public.excel.worksheet.functions
Karim
external usenet poster
 
Posts: 68
Default Macro Help

hi,

i want to create a macro which copy the cell of colume "C"(there is a
formula in column C) when there is any value in cell of colume "A" and paste
only value to Colume "c".

Macro is working in same way but i''m not able to move selection on
worksheet means i'm not able to select any other cell on worksheet.

Please help as i'm new to this.

Macro which i created:-
Public Sub Worksheet_SelectionChange(ByVal Target As Range)

If Cells(Application.ActiveCell.Row, 1) "" Then

Cells(Application.ActiveCell.Row, 3).Copy
Cells(Application.ActiveCell.Row, 3).PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If

End Sub
  #2  
Old May 4th, 2010, 04:31 PM posted to microsoft.public.excel.worksheet.functions
Luke M[_4_]
external usenet poster
 
Posts: 451
Default Macro Help

Assuming that you want to make column C a static value once you've completed
something in column A, your macro would be something like:


Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
If Cells(Target.Row, "A") "" Then
Application.EnableEvents = False
Cells(Target.Row, "C").Value = Cells(Target.Row, "C").Value
Application.EnableEvents = True
End If
End Sub
--
Best Regards,

Luke M
"karim" wrote in message
...
hi,

i want to create a macro which copy the cell of colume "C"(there is a
formula in column C) when there is any value in cell of colume "A" and
paste
only value to Colume "c".

Macro is working in same way but i''m not able to move selection on
worksheet means i'm not able to select any other cell on worksheet.

Please help as i'm new to this.

Macro which i created:-
Public Sub Worksheet_SelectionChange(ByVal Target As Range)

If Cells(Application.ActiveCell.Row, 1) "" Then

Cells(Application.ActiveCell.Row, 3).Copy
Cells(Application.ActiveCell.Row, 3).PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If

End Sub



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:01 PM.


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