This site uses cookies.
Some of these cookies are essential to the operation of the site,
while others help to improve your experience by providing insights into how the site is being used.
For more information, please see the ProZ.com privacy policy.
Hans Lenting Нидерланды Член ProZ.com c 2006 немецкий => голландский
Mar 28, 2024
I'm looking for a macro to merge two adjacent cells either horizontally or vertically. The contents of the cells should be separated by a space character:
Desired result
A1 becomes A1+space+A2
B3 becomes B3+space+B4
[Edited at 2024-03-29 08:25 GMT]
Subject:
Comment:
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
Dan Lucas Великобритания Local time: 03:31 Член ProZ.com c 2014 японский => английский
Seems simple enough
Mar 28, 2024
You mean in Excel, right. Something like this?
Sub Macro1()
Application.DisplayAlerts = False
NewString = Selection.Cells(1).Value & " " & Selection.Cells(2).Value
'Debug.Print NewString
Selection.Merge
Selection.Value = NewString
'Application.DisableAlerts = True
End Sub
On your final use you probably want to set to true again.
Dan
Hans Lenting
Subject:
Comment:
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
Hans Lenting Нидерланды Член ProZ.com c 2006 немецкий => голландский
Автор темы
Thanks
Mar 29, 2024
Thank you, Dan! You put me on the right track. This is what I needed:
Dan Lucas
Subject:
Comment:
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
Dan Lucas Великобритания Local time: 03:31 Член ProZ.com c 2014 японский => английский
VBA FTW
Mar 29, 2024
Glad it's working for you. I think it's wise to avoid merge if you can, and as you clearly have, as structural changes like that can mess up your worksheet pretty quickly.
I know it's fashionable to look down on things like VBA, but it's actually a very practical and handy language if you are working in Office a lot.
Dan
Hans Lenting
Subject:
Comment:
The contents of this post will automatically be included in the ticket generated. Please add any additional comments or explanation (optional)
Manage your TMs and Terms ... and boost your translation business
Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.
Pastey is an innovative desktop application that bridges the gap between human expertise and artificial intelligence. With intuitive keyboard shortcuts, Pastey transforms your source text into AI-powered draft translations.