Excel Loop from English to VBA

  • Thread starter Thread starter Reto Walker
  • Start date Start date
R

Reto Walker

Dear all

I just started using VBA and can not get the following working:

In 'Basic - English'

1 If Cell A1 <>0
2 Then
3 RunMacro A
4 Goto 1
5 Else
6 "continue with Code"

Can someone tell me how to convert the above code to VBA?

Thanks in advance

Celine
 
Hi
maybe something like

sub foo()
if range("A1").value <> 0 then
macro1
end sub
end if
'some other code
end sub
 
Hi Reto,

If Range("A1").Value <> 0 Then
MacroA
Goto 1
Else
'continue
Endif

But don't use Goto, it is rarely necessray, really only required for error
handling. Structure your code to avoid it.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Do until Worksheets("YourWorkSheetName").Cells(1,1) = 0
YourMacroName
Loop

RestOfYourCode
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top