copy data multiple times, identify numbers and increase number with each copy

timtims

New Member
Joined
Jun 20, 2012
Messages
1
Hey guys,

I want to use VBA in excel to assist me with modifying my input file for FEM program Abaqus, here's what i need to do:

One of the steps in the input file needs to be copied and have some important numbers within the input file increased by 1 each time the step is copied. Here is the part of the input file I need to copy and modify -

**
** STEP: line 1
**
*Step, name="line 1", inc=100000000
*Heat Transfer, end=PERIOD, deltmx=1.
0.001, 5., 1e-05, 1.,
**
** LOADS
**
** Name: BODYFLUX-1 Type: Body heat flux
*Dflux
"LINE 1", BF, 5e+08
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-7
**
*Output, field
*Radiation Output
FTEMP,
**
** FIELD OUTPUT: F-Output-8
**
*Element Output, directions=YES
HFL, TEMP
**
** FIELD OUTPUT: F-Output-9
**
*Node Output
NT,
**
** HISTORY OUTPUT: H-Output-5
**
*Output, history
*Radiation Output
FTEMP,
**
** HISTORY OUTPUT: H-Output-6
**
*Contact Output
HFLA, HTL, HTLA
*End Step

I need to copy and increase this information so that the next copy will read instead of "STEP: line 1" it will read "STEP: line 2" and instead of ""LINE 1", BF, 5e+08" it will read ""LINE 2", BF, 5e+08". i need to copy increase these lines of text at 1000 times

I have been working with a looping function but i really dont know what to do, so some help on this would be much appreciated. I hope i have explained what i need to do well enough. please ask me if this is confusing. thank you very much
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,206,814
Messages
6,075,009
Members
446,114
Latest member
FadDak

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