Shortening an equation Help

radar_jynx

New Member
Joined
Mar 16, 2009
Messages
18
Hi i was wondering if its possible turn this equation into an array or some kind of simpler form.

t = Time()

If [F92,E93] = "" Then
[F92,E93] = Str(t)
ElseIf [F93] = "" Then
[G92,F93] = Str(t)
ElseIf [G93] = "" Then
[H92,G93] = Str(t)
ElseIf [H93] = "" Then
[I92,H93] = Str(t)
ElseIf [I93] = "" Then
[J92,I93] = Str(t)
ElseIf [J93] = "" Then
[J93] = Str(t)
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Sorry about that i wont do it again.

yeah "" is testing for null

and your rite i only need

if [E93] = "" then

for the first line , but is there a way i can make the letters incline in 3 particular ranges.
 
Upvote 0
You can use the Cells property in a loop like this:

Code:
For c = 5 to 10
    With Cells(93, c)
        If .Value = "" Then .Value = Str(t)
        Exit For
    End With
Next c

That fills the first blank cell and stops.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

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