can i put a variable inside timeserial?

earp_

Active Member
Joined
Apr 30, 2008
Messages
305
I have this
'7.05
If .Value >= TimeSerial(7, 0, 0) And .Value < TimeSerial(7, 5, 0) Then
With ThisWorkbook
Worksheets("Sheet1").Range("B2").Copy
Worksheets("Sheet2").Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial xlValues
End With
End If
If I want to change
TimeSerial(7, 5, 0) into TimeSerial(7, 10, 0)
using a variable X, is it possible?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Just make your TimeSerial expresiion be:

TimeSerial(7, X, 0)

and then adjust whatever value X holds which will then flow thru to the timeSerial expression.
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,185
Members
449,071
Latest member
cdnMech

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