#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 361
Default Macro Question

I have this basic macro that I am trying to modify.

First mod I am trying to implement is to have the macro refer to a list I
have in B3:B10 and perform the copy (Line3 below) for each value in B3:B10.

2nd mod is after Line7, wait until a value is returned in H1 before
performing Line9.


1Sub Macro1()
2 Range("B3").Select
3 Selection.Copy
4
5 Range("G1").Select
6
7 ActiveSheet.Paste
8
9 Range("G1:H1").Select
10
11 Application.CutCopyMode = False
12
13 Selection.Copy
14
15 Range("B11").Select
16
17 Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
18
19 :=False, Transpose:=False
20
21 End Sub

Thank You in Advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,726
Default Macro Question

What does ... 2nd mod is after Line7, wait until a value is returned in H1
before
performing Line9 ... mean, that you want the macro to pause until someone
inputs?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"carl" wrote in message
...
I have this basic macro that I am trying to modify.

First mod I am trying to implement is to have the macro refer to a list I
have in B3:B10 and perform the copy (Line3 below) for each value in
B3:B10.

2nd mod is after Line7, wait until a value is returned in H1 before
performing Line9.


1Sub Macro1()
2 Range("B3").Select
3 Selection.Copy
4
5 Range("G1").Select
6
7 ActiveSheet.Paste
8
9 Range("G1:H1").Select
10
11 Application.CutCopyMode = False
12
13 Selection.Copy
14
15 Range("B11").Select
16
17 Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
18
19 :=False, Transpose:=False
20
21 End Sub

Thank You in Advance.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 361
Default Macro Question

Thank you Bob for helping.

There is a formula in H1. Sometimes the result takes 10 to 40 seconds to
appear in the cell. While calculating, the cell displays N/A.

"Bob Phillips" wrote:

What does ... 2nd mod is after Line7, wait until a value is returned in H1
before
performing Line9 ... mean, that you want the macro to pause until someone
inputs?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"carl" wrote in message
...
I have this basic macro that I am trying to modify.

First mod I am trying to implement is to have the macro refer to a list I
have in B3:B10 and perform the copy (Line3 below) for each value in
B3:B10.

2nd mod is after Line7, wait until a value is returned in H1 before
performing Line9.


1Sub Macro1()
2 Range("B3").Select
3 Selection.Copy
4
5 Range("G1").Select
6
7 ActiveSheet.Paste
8
9 Range("G1:H1").Select
10
11 Application.CutCopyMode = False
12
13 Selection.Copy
14
15 Range("B11").Select
16
17 Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
18
19 :=False, Transpose:=False
20
21 End Sub

Thank You in Advance.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,726
Default Macro Question

You can't sit waiting for that in the macro, you would never know.

What you could do is test the first part, then schedule the rest for running
say a minute later.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"carl" wrote in message
...
Thank you Bob for helping.

There is a formula in H1. Sometimes the result takes 10 to 40 seconds to
appear in the cell. While calculating, the cell displays N/A.

"Bob Phillips" wrote:

What does ... 2nd mod is after Line7, wait until a value is returned in
H1
before
performing Line9 ... mean, that you want the macro to pause until someone
inputs?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"carl" wrote in message
...
I have this basic macro that I am trying to modify.

First mod I am trying to implement is to have the macro refer to a list
I
have in B3:B10 and perform the copy (Line3 below) for each value in
B3:B10.

2nd mod is after Line7, wait until a value is returned in H1 before
performing Line9.


1Sub Macro1()
2 Range("B3").Select
3 Selection.Copy
4
5 Range("G1").Select
6
7 ActiveSheet.Paste
8
9 Range("G1:H1").Select
10
11 Application.CutCopyMode = False
12
13 Selection.Copy
14
15 Range("B11").Select
16
17 Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
18
19 :=False, Transpose:=False
20
21 End Sub

Thank You in Advance.






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 361
Default Macro Question

Thanks Bob. Is it possible to build in a set delay (say 60 seconds) after
Line7 but before Line9 ?

"Bob Phillips" wrote:

You can't sit waiting for that in the macro, you would never know.

What you could do is test the first part, then schedule the rest for running
say a minute later.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"carl" wrote in message
...
Thank you Bob for helping.

There is a formula in H1. Sometimes the result takes 10 to 40 seconds to
appear in the cell. While calculating, the cell displays N/A.

"Bob Phillips" wrote:

What does ... 2nd mod is after Line7, wait until a value is returned in
H1
before
performing Line9 ... mean, that you want the macro to pause until someone
inputs?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"carl" wrote in message
...
I have this basic macro that I am trying to modify.

First mod I am trying to implement is to have the macro refer to a list
I
have in B3:B10 and perform the copy (Line3 below) for each value in
B3:B10.

2nd mod is after Line7, wait until a value is returned in H1 before
performing Line9.


1Sub Macro1()
2 Range("B3").Select
3 Selection.Copy
4
5 Range("G1").Select
6
7 ActiveSheet.Paste
8
9 Range("G1:H1").Select
10
11 Application.CutCopyMode = False
12
13 Selection.Copy
14
15 Range("B11").Select
16
17 Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
18
19 :=False, Transpose:=False
20
21 End Sub

Thank You in Advance.








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Macro Question

Check out VBA help on "wait method".

Pauses a running macro until a specified time. Returns True if the specified
time has arrived.

Important The Wait method suspends all Microsoft Excel activity and may prevent
you from performing other operations on your computer while Wait is in effect.
However, background processes such as printing and recalculation continue.


Gord Dibben MS Excel MVP

On Sat, 10 Feb 2007 09:59:00 -0800, carl wrote:

Thanks Bob. Is it possible to build in a set delay (say 60 seconds) after
Line7 but before Line9 ?

"Bob Phillips" wrote:

You can't sit waiting for that in the macro, you would never know.

What you could do is test the first part, then schedule the rest for running
say a minute later.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"carl" wrote in message
...
Thank you Bob for helping.

There is a formula in H1. Sometimes the result takes 10 to 40 seconds to
appear in the cell. While calculating, the cell displays N/A.

"Bob Phillips" wrote:

What does ... 2nd mod is after Line7, wait until a value is returned in
H1
before
performing Line9 ... mean, that you want the macro to pause until someone
inputs?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"carl" wrote in message
...
I have this basic macro that I am trying to modify.

First mod I am trying to implement is to have the macro refer to a list
I
have in B3:B10 and perform the copy (Line3 below) for each value in
B3:B10.

2nd mod is after Line7, wait until a value is returned in H1 before
performing Line9.


1Sub Macro1()
2 Range("B3").Select
3 Selection.Copy
4
5 Range("G1").Select
6
7 ActiveSheet.Paste
8
9 Range("G1:H1").Select
10
11 Application.CutCopyMode = False
12
13 Selection.Copy
14
15 Range("B11").Select
16
17 Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
18
19 :=False, Transpose:=False
20
21 End Sub

Thank You in Advance.







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
Excel Macro question Greg Excel Discussion (Misc queries) 4 February 8th 07 05:57 PM
Yet another Lotus macro question Monty New Users to Excel 2 February 7th 07 01:44 PM
question about syntax in a simple macro... Dave F Excel Discussion (Misc queries) 3 November 3rd 06 02:12 PM
Macro Question sony654 Excel Worksheet Functions 3 February 27th 06 09:55 PM
Macro question Terry Bennett Excel Worksheet Functions 9 January 22nd 06 10:39 PM


All times are GMT +1. The time now is 04:11 AM.

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

About Us

"It's about Microsoft Excel"