Goal: To get the column number from where we have copied a particular CELL
Goal: To get the column number from where we have copied a particular CELL
Hi Gaikwad,
You can store the column number in a variable "i" using below code:-
Regards,Please Login or Register to view this content.
DILIPandey
<click on below * if this helps>
DILIPandey, Excel rMVP
+919810929744 (India), +971528225509 (Dubai), [email protected]
Thanks Dilip,
I' ll tell you my actual requirement,
I' am using a code where I' have blocked many copy paste scenario. but now I' want to allow user to copy paste within a single column.
example:
as per my code if I' copy content from A1 it will not paste in B1, C1 or any other Cell even in A2.
Now I' want to change it like if I' copied from A1 then it should paste in A2, A3, A4, or any other cells in the same column.
please help me with this
Thanks
Okay.. so I believe, you can simply use range("a2").pastespecial.
Regards,
DILIPandey
<click on below * if this helps>
Did Get You....
Could you please give me the Code for the same.
Already given code line in my post #4 ...
Regards,
DILIPandey
<click on below * if this helps>
I need code as below:
If Cell is copied from Column Number ex:10 [same sheet] Then
It Can be paste any Cell in the column 10
Else
My conditional Code.
End If
##### How to write this???? #####
Okay..
First, you need to decide what you need - are you controlling the user's action -> Y/N
If Y, then you need to do it using worksheet change / selection change events
If N, then its you who would be creating the code and hence create the code as you want
so for copying the data in column A and paste in Column A only
like :-
Range("a1").copy
Range("a2").pastespeical
Above code will copy data in column A and will paste in column A - because thats the way it has been written .. hope this is clear to you now. Thx
Regards,
DILIPandey
<click on below * if this helps>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks