Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Macro help (not the sharpest tool in the shed)

I was wandering€¦ hoping if someone could help me with a macro.

In excel I have a list of IPs in a column like this:


10.162.164.82
10.162.164.84
10.162.164.85
10.162.164.87
10.162.164.89

There could be hundreds of them.

I need to add these rows in between each IP. Like this:

10.162.164.81
WAIT ""
SEND "ftp-config: 0\m"
WAIT ""
SEND "set-cmnty-name: MVHU\m"
WAIT ""
SEND "exit"
WAIT ""
SEND "Y"
10.162.164.84
WAIT ""
SEND "ftp-config: 0\m"
WAIT ""
SEND "set-cmnty-name: MVHU\m"
WAIT ""
SEND "exit"
WAIT ""
SEND "Y"

And so forth. Can someone help me?
I think I could figure out how to modify the script once I had it (ie
different lines of text and/or more or less lines of text) I would greatly
appreciate it if you could share what so easily comes to your mind that which
is having trouble getting through my thick skull!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Macro help (not the sharpest tool in the shed)

Dano,

We'll sharpen you right up....

Put your eight lines:

WAIT ""
SEND "ftp-config: 0\m"
WAIT ""
SEND "set-cmnty-name: MVHU\m"
WAIT ""
SEND "exit"
WAIT ""
SEND "Y"

into a range of cells - let's say, E1:E8. Then with you list of IP is
column A, starting in row 1, run this macro:

Sub InsertCode()
Dim i As Long
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
Range("E1:E8").Copy
Cells(i + 1, 1).insert xlShiftDown
Next i
End Sub

HTH,
Bernie
MS Excel MVP


"Dano" wrote in message
...
I was wandering. hoping if someone could help me with a macro.

In excel I have a list of IP's in a column like this:


10.162.164.82
10.162.164.84
10.162.164.85
10.162.164.87
10.162.164.89

There could be hundreds of them.

I need to add these rows in between each IP. Like this:

10.162.164.81
WAIT ""
SEND "ftp-config: 0\m"
WAIT ""
SEND "set-cmnty-name: MVHU\m"
WAIT ""
SEND "exit"
WAIT ""
SEND "Y"
10.162.164.84
WAIT ""
SEND "ftp-config: 0\m"
WAIT ""
SEND "set-cmnty-name: MVHU\m"
WAIT ""
SEND "exit"
WAIT ""
SEND "Y"

And so forth. Can someone help me?
I think I could figure out how to modify the script once I had it (ie
different lines of text and/or more or less lines of text) I would
greatly
appreciate it if you could share what so easily comes to your mind that
which
is having trouble getting through my thick skull!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Including Solver Tool in a Macro JoLeigh Excel Programming 2 March 21st 08 11:12 PM
excel 4.0 macro remover tool Sachin Shah Excel Discussion (Misc queries) 0 August 25th 05 04:14 AM
macro on tool bar Randy Starkey Excel Programming 1 March 24th 05 11:50 PM
Macro & Tool Bar Sharing Juan[_3_] Excel Programming 2 February 24th 04 05:59 PM
Macro tool for solver Aidan[_3_] Excel Programming 3 January 12th 04 11:49 PM


All times are GMT +1. The time now is 09:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"