VBA learner ITG
Active Member
- Joined
- Apr 18, 2017
- Messages
- 272
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi all,
Any advice would be appreciated on this!
Column P of my workbook is a numerical column and Column Q is a Currency sign indicator, I need to add the Currency sign indicator to the front of the cell in column P or at the end depending on the currency sign indicator.
£ = UK Pounds
P = UK Pence
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column P[/TD]
[TD]Column Q[/TD]
[/TR]
[TR]
[TD]1.50[/TD]
[TD]£[/TD]
[/TR]
[TR]
[TD]50[/TD]
[TD]P[/TD]
[/TR]
</tbody>[/TABLE]
so the output would look like the below
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column P[/TD]
[TD]Column Q[/TD]
[/TR]
[TR]
[TD]£1.50[/TD]
[TD]£[/TD]
[/TR]
[TR]
[TD]50P[/TD]
[TD]P[/TD]
[/TR]
</tbody>[/TABLE]
Is this achieving in column P without adding another column to the table using VBA?
I have tried the below code but it will only concatenate the value at the front of the cell value.
Any advice would be appreciated on this!
Column P of my workbook is a numerical column and Column Q is a Currency sign indicator, I need to add the Currency sign indicator to the front of the cell in column P or at the end depending on the currency sign indicator.
£ = UK Pounds
P = UK Pence
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column P[/TD]
[TD]Column Q[/TD]
[/TR]
[TR]
[TD]1.50[/TD]
[TD]£[/TD]
[/TR]
[TR]
[TD]50[/TD]
[TD]P[/TD]
[/TR]
</tbody>[/TABLE]
so the output would look like the below
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column P[/TD]
[TD]Column Q[/TD]
[/TR]
[TR]
[TD]£1.50[/TD]
[TD]£[/TD]
[/TR]
[TR]
[TD]50P[/TD]
[TD]P[/TD]
[/TR]
</tbody>[/TABLE]
Is this achieving in column P without adding another column to the table using VBA?
I have tried the below code but it will only concatenate the value at the front of the cell value.
Code:
For i = 2 To Cells(Rows.Count, "P").End(xlUp).Row
Cells(i, "P").Value = Cells(i, "Q").Value & "" & Cells(i, "P").Value
Next i