ISEMPTY does not want to work properly. Someone help me out of this.

Sphinx404

Board Regular
Joined
May 2, 2015
Messages
186
Office Version
  1. 365
Platform
  1. Windows
I am looking to fill in blanks in the selected range with the word "Research"

IF the cell is blank then
cell = "Research"

Simple enough, yet my mind is drawing a blank. The code below puts the word "Research" in the Header (U1), instead of in the blank cell. Something is missing, what in what in the name of Tom Selleck's mustache am I doing wrong. UGH!

Code:
Dim mycell As Range


For Each mycell In Range("U2", Range("U" & Rows.Count).End(xlUp))


Select Case True
    Case IsEmpty(mycell.Value)
        If IsEmpty(mycell.Value) Then
            mycell.Value = "Research"
        End If
End Select


Next mycell

thanks
 
Below contains all the code in this module.... I just started it, so it's not long... I've been looking for other errors... but first 2 subs work exactly like I need them to....

Code:
Sub LenAirwayBills()


Dim mycell As Range


For Each mycell In Range("E2", Range("E" & Rows.Count).End(xlUp))


If Len(mycell) = 14 Then
    mycell.Offset(, 16).Value = Right(mycell.Value, 8)
End If


If Len(mycell) = 21 Then
    mycell.Offset(, 16).Value = "UPS"
End If


If Len(mycell) = 22 Then
    mycell.Offset(, 16).Value = "UPS"
End If


If Len(mycell) <= 7 Then
    mycell.Offset(, 16).Value = "Research"
End If


If Len(mycell) = 9 Then
    mycell.Offset(, 16).Value = "Unknown"
End If


If Len(mycell) >= 23 Then
    mycell.Offset(, 16).Value = "Research"
End If




Next mycell




End Sub


Sub Cases()


Dim mycell As Range


For Each mycell In Range("E2", Range("E" & Rows.Count).End(xlUp))


Select Case True
    Case Left(mycell.Value, 2) = "06"
        If IsNumeric(Right(mycell.Value, 8)) Then
            mycell.Offset(, 16).Value = Right(mycell.Value, 8)
        End If
    Case UCase(mycell.Value) Like "1Z*" Or mycell.Value Like "UPS*"
            mycell.Offset(, 16).Value = "UPS"
    Case mycell.Value Like "*FED*" Or mycell.Value Like "FEDEX"
            mycell.Offset(, 16).Value = "FEDEX"
    Case mycell.Value Like "*DHL*"
            mycell.Offset(, 16).Value = "DHL"
    Case mycell.Value Like "EXPO*"
            mycell.Offset(, 16).Value = "EXPO"
    Case mycell.Value Like "STERL*"
            mycell.Offset(, 16).Value = "STERLING"
    Case UCase(mycell.Value) Like "CHART*"
            mycell.Offset(, 16).Value = "CHARTER"
    Case mycell.Value Like "*TRUCK*"
            mycell.Offset(, 16).Value = "TRUCK"
    Case mycell.Value Like "*-*"
            mycell.Offset(, 16).Value = "Research"
End Select


Next mycell


End Sub


******* SUB THAT WON"T WORK*******

'Sub Findtheblankspots()


'With Range("U2:U" & Cells(Rows.Count, "U").End(xlUp).Row)
    '.Value = Evaluate("=IF(" & .Address & "="""",""Research""," & .Address & ")")
'End With






'Dim mycell As Range


'For Each mycell In Range("U2", Range("U" & Rows.Count).End(xlUp))


'Select Case True
    'Case IsEmpty(mycell.Value)
       ' If IsEmpty(mycell.Value) Then
          '  mycell.Value = "Research"
      '  End If
'End Select


'Next mycell




'End Sub
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
How about
Code:
    Dim UsdRws As Long

    UsdRws = Cells.Find("*", After:=Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    Range("U2:U" & UsdRws).SpecialCells(xlBlanks).Value = "Research"

This worked! You know @Fluff, a lot of my code is "YOUR" code. You guys are all great.... You have no idea how much I continue to refer back to the answers I get. We'll see what else comes out of this thread. Thanks.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,331
Members
452,636
Latest member
laura12345

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