From: Gord Dibben on
Gary

I completely failed to understand the needs but now I see your code in
action I am impressed.

Both with the code and your interpretaion of OP's question.


Gord

On Thu, 15 Apr 2010 12:38:01 -0700, Gary Brown <junk_at_kinneson_dot_com>
wrote:

>After looking at your response to Gord Dibben, I've changed the macro so the
>Text goes in Cell A105. You can easily change this in the macro.
>
>'/=================================================
>Sub Macro1()
> Dim i As Integer, j As Integer
> Dim x As Integer, y As Integer
> Dim strMyCell As String
>'
>
> ' - - V A R I A B L E S - - - - -
> strMyCell = "A105" 'where TEXT goes
> x = 10 'indent 10 times
> y = 5 'perform process 5 times
> ' - - - - - - - - - - - - - - - -
>
> For j = 1 To y
> For i = 1 To x
> 'wait 1 second between indent
> Application.Wait (Now + TimeValue("0:00:01"))
> 'indent
> Range(strMyCell).InsertIndent 1
> Next i
> 'un-indent same # of times you
> ' indented to start again
> Range(strMyCell).InsertIndent -x
> Next j
>
>End Sub
>'/=================================================

From: MAX on
One last quetion, why I can't write on the file while the code is running?

"Gord Dibben" wrote:

> Gary
>
> I completely failed to understand the needs but now I see your code in
> action I am impressed.
>
> Both with the code and your interpretaion of OP's question.
>
>
> Gord
>
> On Thu, 15 Apr 2010 12:38:01 -0700, Gary Brown <junk_at_kinneson_dot_com>
> wrote:
>
> >After looking at your response to Gord Dibben, I've changed the macro so the
> >Text goes in Cell A105. You can easily change this in the macro.
> >
> >'/=================================================
> >Sub Macro1()
> > Dim i As Integer, j As Integer
> > Dim x As Integer, y As Integer
> > Dim strMyCell As String
> >'
> >
> > ' - - V A R I A B L E S - - - - -
> > strMyCell = "A105" 'where TEXT goes
> > x = 10 'indent 10 times
> > y = 5 'perform process 5 times
> > ' - - - - - - - - - - - - - - - -
> >
> > For j = 1 To y
> > For i = 1 To x
> > 'wait 1 second between indent
> > Application.Wait (Now + TimeValue("0:00:01"))
> > 'indent
> > Range(strMyCell).InsertIndent 1
> > Next i
> > 'un-indent same # of times you
> > ' indented to start again
> > Range(strMyCell).InsertIndent -x
> > Next j
> >
> >End Sub
> >'/=================================================
>
> .
>
From: Gord Dibben on
Because Excel can do one thing at a time.

While your code is running you must suspend all other activity.

Cool, eh?


Gord

On Thu, 15 Apr 2010 13:58:01 -0700, MAX <MAX(a)discussions.microsoft.com>
wrote:

>One last quetion, why I can't write on the file while the code is running?
>
>"Gord Dibben" wrote:
>
>> Gary
>>
>> I completely failed to understand the needs but now I see your code in
>> action I am impressed.
>>
>> Both with the code and your interpretaion of OP's question.
>>
>>
>> Gord
>>
>> On Thu, 15 Apr 2010 12:38:01 -0700, Gary Brown <junk_at_kinneson_dot_com>
>> wrote:
>>
>> >After looking at your response to Gord Dibben, I've changed the macro so the
>> >Text goes in Cell A105. You can easily change this in the macro.
>> >
>> >'/=================================================
>> >Sub Macro1()
>> > Dim i As Integer, j As Integer
>> > Dim x As Integer, y As Integer
>> > Dim strMyCell As String
>> >'
>> >
>> > ' - - V A R I A B L E S - - - - -
>> > strMyCell = "A105" 'where TEXT goes
>> > x = 10 'indent 10 times
>> > y = 5 'perform process 5 times
>> > ' - - - - - - - - - - - - - - - -
>> >
>> > For j = 1 To y
>> > For i = 1 To x
>> > 'wait 1 second between indent
>> > Application.Wait (Now + TimeValue("0:00:01"))
>> > 'indent
>> > Range(strMyCell).InsertIndent 1
>> > Next i
>> > 'un-indent same # of times you
>> > ' indented to start again
>> > Range(strMyCell).InsertIndent -x
>> > Next j
>> >
>> >End Sub
>> >'/=================================================
>>
>> .
>>