Put text in a different cell than the function is.

BAKELOVEMORE

New Member
Joined
Apr 2, 2024
Messages
13
Office Version
  1. 365
Platform
  1. Windows
I want to move the IF statements into column BI so the function is not shown in the function bar. As it is now, have to delete the function to place other text.
I have tried using concat, text, isnumber, &, vlookup, xlookup, textjoin, etc. both in cells and in VBA and I just cannot get it to work.
Check G column for "ØCAM" and IF TRUE insert "LRV NOT CONNECTING TO NETWORK" in H column same row but have the if check in BI or VBA so it doesn't show in column H so other data can be typed in without having to delete the statement.

Thanks

excel template.jpg
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Welcome to the Forum!

This sounds like a job for VBA. Perhaps something along these lines:

VBA Code:
'In the relevant Sheet module
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim rngToMonitor As Range, r As Range
    Dim s As String
    
    Set rngToMonitor = Intersect(Range("G3:G100"), Target)
    
    If Not rngToMonitor Is Nothing Then
        s = "LRV NOT CONNECTING TO NETWORK"
        Application.EnableEvents = False
        For Each r In rngToMonitor
            If r.Value = "ØCAM" Then
                r.Offset(, 1).Value = s
            Else
                If r.Offset(, 1).Value = s Then r.Offset(, 1).Value = ""
            End If
        Next r
        Application.EnableEvents = True
    End If

End Sub
 
Upvote 0
Solution
Welcome to the Forum!

This sounds like a job for VBA. Perhaps something along these lines:

VBA Code:
'In the relevant Sheet module
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim rngToMonitor As Range, r As Range
    Dim s As String
   
    Set rngToMonitor = Intersect(Range("G3:G100"), Target)
   
    If Not rngToMonitor Is Nothing Then
        s = "LRV NOT CONNECTING TO NETWORK"
        Application.EnableEvents = False
        For Each r In rngToMonitor
            If r.Value = "ØCAM" Then
                r.Offset(, 1).Value = s
            Else
                If r.Offset(, 1).Value = s Then r.Offset(, 1).Value = ""
            End If
        Next r
        Application.EnableEvents = True
    End If

End Sub
That worked perfectly. I need to get further in my vba manual I see. A lot more elegant than the brute force coding I was trying.
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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