Oct 07 2020 04:32 AM
Oct 07 2020 05:12 AM
As Mr Hans Vogelaar (@Hans Vogelaar) gave you as advice, I can only recommend it to you,
please add a file (without sensitive data) and describe your plan on it.
This means that you can be helped more quickly
and the best possible solution tailored to your needs can be offered.
So everyone is helped...Help to be helped.
* It's always good to add your operating system and Excel version.
Nevertheless, here is a little VBA code for an easy copy / paste with VBA.
Public Sub Copy_Paste()
With Worksheets("Sheet1")
.Range(.Cells(1, 1), .Cells(10, 3)).Copy Destination:=.Cells(11, 4)
End With
End Sub
'Change the cell / column according to your needs.
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
Oct 08 2020 12:36 AM
Thanks Hans for your reply.
A | B | C | |
1 | Krishna Yadav | ||
2 | Rama |
I wanted to create a Macro to cut/copy text "Krishna" from cell A1 and paste and append it to "Rama" in cell say C2, to make it "Rama Krishna" in cell C2.
That is the only requirement.
I think I have made my problem clear.
Expect solution.
Regards,
Hemant
Oct 08 2020 12:38 AM
Dear Nikolino, Thanks for reply.
A | B | C | |
1 | Krishna Yadav | ||
2 | Rama |
I wanted to create a Macro to cut/copy text "Krishna" from cell A1 and paste and append it to "Rama" in cell say C2, to make it "Rama Krishna" in cell C2.
That is the only requirement.
I think I have made my problem clear.
Expect solution.
Regards,
Hemant
Oct 08 2020 01:46 AM
For example:
Sub MoveText()
Dim strText As String
strText = "Krishna"
Range("A1").Value = Trim(Replace(Range("A1").Value, strText, ""))
Range("C2").Value = Range("C2").Value & " " & strText
End Sub
Oct 08 2020 06:19 AM
Thank you for the feedback
No problem, I just pointed it out to you so that you should get the best possible solution.
So Please do not misunderstand my contribution.
So far i see Mr.@Hans Vogelaar give you a solution.
If you like Mr. @Hans Vogelaar solution, please mark it with a like or as the best answer to Mr. @Hans Vogelaar contribution, it will be beneficial to more Community members reading here.
Thank you for your understanding and patience.
Nikolino
I know I don't know anything (Socrates)
Oct 08 2020 09:59 PM
Dear Hans,
Thanks for your interest in my problem.
Your solution is working. But it moves the text "krishna" only. It works every where wherever there is text "Krishna". But I want to move the word which I select after going to any particular cell in the sheet. It can be any word. Explained further below.
A | B | C | |
1 | Krishna Yadav | Rama | |
2 | satish pulekar | jerry | |
3 | john dsouza | Kamat |
When I will go to cell A1 and select "Krishna" and press the shortcut key for the macro, it should cut "Krishna" and cell C1 should become "Rama Krishna".
Similarly,
When I go to cell A2 and select "pulekar" and press the shortcut key for the macro, it should cut "pulekar " and cell C2 should become "jerry pulekar".
When I go to cell A3 and select "john" and press the shortcut key for the macro, it should cut "john" and cell C3 should become "Kamat".
I have to do such job for about 500 cells which are discontinuous. ( separated from each other)
Regards,
Hemant
Oct 08 2020 11:40 PM
That is not possible. When you select a word in a cell, Excel is in edit mode. Macros cannot be run while Excel is in edit mode.
We could change the macro to prompt for the word to move. Would that be OK?