Mixing text and times

paulsolar

Well-known Member
Joined
Aug 21, 2013
Messages
691
Office Version
  1. 365
Hi All

I'm have a problem combining two columns into one. The code below does what I want

Sheets("Calculations").Range("K2") = Sheets("Calculations").Range("J2").Value & Sheets("Calculations").Range("I2").Text

J2 contains a value and I2 contains the time and works as in it displays:- Commences: 07:31 which is what i want to achieve.

How do i convert the below to make it put the correct values in all the rows ie: K3=J3 & J4.........

Sheets("Calculations").Range("K2:K" & LastRow2) = Sheets("Calculations").Range("J2").Value & Sheets("Calculations").Range("I2").Text (obviously this puts the J2 and I2 values in every row)

I have tried doing it with formula, the problem is that it changes back to time format as a number and I have tried everything i know to sort this out without any luck.

Any help would be appreciated

cheers

Paul
 
Last edited:

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I have tried doing it with formula, the problem is that it changes back to time format as a number and I have tried everything i know to sort this out without any luck.

Hi, if you are still interested in pursuing a formula solution - you could try like this:


Excel 2013/2016
IJK
207:31Commences:Commences:07:31
Sheet1
Cell Formulas
RangeFormula
K2=J2&TEXT(I2,"hh:mm")
 
Upvote 0
How about
Code:
Sub paulsolar()
   With Range("K2:K10")
      .Formula = "=j2&text(i2,""hh:mm"")"
      .Value = .Value
   End With
End Sub
 
Upvote 0
thats brilliant, i tried every variation of your formula(including text), but not at the same time

thanks for your help, i cant believe how simple it should have been for me :)
 
Upvote 0
As you've decided to ignore me (as we posted at the same time) all I can say is

Come on Fiji :nya: :rofl:
 
Last edited:
Upvote 0
OMG Fluff, I missed your post it must have crossed with my reply.

i get down on my knees and beg your forgiveness :-), please can you withdraw that dreadful statement and say COME ON YOU WELSH and I'll same come on England (admittedly very quietly) when we meet you in the finals :pray:

best of luck

cheers

Paul
 
Upvote 0
I think that's pushing it a bit, but maybe
Come on you Reds
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top