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

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Weaver

Well-known Member
Joined
Sep 10, 2008
Messages
5,196
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
 

rifleforger

New Member
Joined
Aug 1, 2010
Messages
6
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
 

Forum statistics

Threads
1,136,953
Messages
5,678,749
Members
419,782
Latest member
gc75150

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
Top