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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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,391
Messages
6,119,247
Members
448,879
Latest member
oksanana

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