# need help with a If=then situation.

1. ## need help with a If=then situation.

I have a little Excel file to use transcribing some old paper data

The field is a 4 digit number representing a 24 hour moment
0522 would be 5:22 am.
all I want to enter is they 4 digit number

Many entries would be the same, as the entries all happened in the same
minute
so what I'd like to do, is...
If I leave the field blank, it would fill itself with the time put into the
field above it.
All the fields in the column are 4 digit
I tried to do a =if B4>=0, " " then B5=B6

I'm missing something as I haven't done that much with Excel yet.

--

-----------------------------------------------------
2400 Baud makes you want to get out and push!!
-----------------------------------------------------

Bill H. in Chicagoland  Register To Reply

2. I think you could just put this in cell b5 and copy down as far as you (assuming you input a time in cell b4)

=b4  Register To Reply

3. ## Re: need help with a If=then situation.

Bill,

The easiest is a formula :
=VALUE(LEFT(H6,2)&":"&RIGHT(H6,2))
and then format the cell with time ...

HTH
Carim  Register To Reply

4. ## RE: need help with a If=then situation.

I'm not sure I follow your If-Then statement but this may help. This macro
uses the Worksheet_change event (right click the sheet tab, select View Code
and paste macro to the code sheet displayed).

If you enter a value in column B any blank cells immediately above the cell
just changed will be populated with the value of the last used cell in column
B.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim lastused As Long
Dim counter As Long
If Target.Column = 2 And Target.Row > 1 Then
If IsEmpty(Target.Offset(-1, 0)) Then
lastused = Target.End(xlUp).Row
For counter = lastused + 1 To Target.Row - 1
Cells(counter, 2).Value = Cells(counter - 1, 2).Value
Next counter
End If
End If
End Sub

Regards
Rowan

"FireBrick" wrote:

> I have a little Excel file to use transcribing some old paper data
>
> The field is a 4 digit number representing a 24 hour moment
> 0522 would be 5:22 am.
> all I want to enter is they 4 digit number
>
> Many entries would be the same, as the entries all happened in the same
> minute
> so what I'd like to do, is...
> If I leave the field blank, it would fill itself with the time put into the
> field above it.
> All the fields in the column are 4 digit
> I tried to do a =if B4>=0, " " then B5=B6
>
> I'm missing something as I haven't done that much with Excel yet.
>
>
> --
>
>
> -----------------------------------------------------
> 2400 Baud makes you want to get out and push!!
> -----------------------------------------------------
>
> Bill H. in Chicagoland
>
>
>  Register To Reply

5. ## Re: need help with a If=then situation.

"FireBrick" <w9ol.nospam@comcast.com>ha scritto nel messaggio
OhRY4UsSFHA.3188@TK2MSFTNGP09.phx.gbl

> I have a little Excel file to use transcribing some old paper data
>
> The field is a 4 digit number representing a 24 hour moment
> 0522 would be 5:22 am.
> all I want to enter is they 4 digit number
>
> Many entries would be the same, as the entries all happened in the
> same minute
> so what I'd like to do, is...
> If I leave the field blank, it would fill itself with the time put
> into the field above it.
> All the fields in the column are 4 digit

I think this should work:
1) menu Edit => Go to => Special... select the option Blank cells and then
OK
2) digit = and then with the up arrow select the cell above the first blank
cell;
3) press ctrl+enter;
4) select the column with you filled in this way and then select Edit =>
copy and after Edit => copy/paste Special Values.

--

Regards

Franz

----------------------------------------------------------------------------------------
To reply translate from italian InVento (no capital letters)
----------------------------------------------------------------------------------------  Register To Reply