happydonut
Board Regular
- Joined
- Nov 28, 2019
- Messages
- 57
- Office Version
-
- 365
- Platform
-
- Windows
Hello,
I have this code to add the value from two cells into one;
The cell in A1 has a date, e.g. 2021-01-25
The cell in B1 has a number, e.g. 123456789
Goal is to have the value in C1 as MMDD from cell A1 followed by the value in B1, e.g. 0125 123456789
Questions:
1. How do I format the C1 to get the value there as explained?
2. In real life, there could be many rows in A1 (all dates) and B1 (all numbers). How can I make a code that takes all rows into consideration, e.g. A2+B2=C2, A3+B3=C3 etc until last row with a value?
Thanks.
I have this code to add the value from two cells into one;
VBA Code:
Range("C1").Value = Range("A1").Value & " " & Range("B1").Value
The cell in A1 has a date, e.g. 2021-01-25
The cell in B1 has a number, e.g. 123456789
Goal is to have the value in C1 as MMDD from cell A1 followed by the value in B1, e.g. 0125 123456789
Questions:
1. How do I format the C1 to get the value there as explained?
2. In real life, there could be many rows in A1 (all dates) and B1 (all numbers). How can I make a code that takes all rows into consideration, e.g. A2+B2=C2, A3+B3=C3 etc until last row with a value?
Thanks.