Auto inserting a text in a cell

rifleforger

New Member
Joined
Aug 1, 2010
Messages
6
Hi guys,

For Each detect In Range("I1", Cells(Rows.Count, "I").End(xlUp))
If detect.Value = "Modem" Then <--Insert "N/A" in Ip add column
Next detect

What I want to happen is that once the word modem is detected I want to automatically insert the "N/A" in another column(Ip address)?

can you guys help me out?

Device Type Ip Address
Modem N/A

Thanks and Regards,
rifle
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Something like:

Code:
For Each detect In Range("I1", Cells(Rows.Count, "I").End(xlUp))
If detect.Value = "Modem" Then cells(detect.row,"IP") = "N/A"
Next detect
 
Upvote 0
Something like:

Code:
For Each detect In Range("I1", Cells(Rows.Count, "I").End(xlUp))
If detect.Value = "Modem" Then cells(detect.row,"IP") = "N/A"
Next detect

I tried it but it work but i get an error

Run-time error '-2147417848 (80010108);
Method '_Default of object 'Range' failed

And after getting the error my spreadsheet just froze. I can't edit anything
 
Upvote 0

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

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