VBA Writing style. Advise

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
1. I was writing macro manually and I dotn know what I did but the cursor blink became bold and I dont know how to return that to normal cursor mode
2. Is manual way of writing macro called relative macro or othewise what is it called....?
3. I have seen someone write a macro in style like below code....it move the line in and then come out again...
do we manually do that as does it automatically happen...
because when i write the code it does not happen...
Code:
Sub try2()
With Sheet1
  lr = .Cells(Rows.Count, "A").End(xlUp).Row
    For i = 2 To lr
      If .Cells(i, "D").Value >= .Cells(2, "H").Value Then
         .Range("A" & i & ":G" & lr).Copy Sheets("Home").Range("A1")
       Exit For
     End If
   Next i
 End With
End Sub
Thanks again!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I dont know what is toggled....:biggrin:
How are we suppose to toggle...like manually you mean?
 
Upvote 0
The cursor blink is really huge now...10x more to normal cursor blink...it is soo distracting....i dont know why...how can i make it smaller...?:biggrin:
 
Upvote 0
i dont know how but after i close & reopen it is okay now...i mean the bold bog cursor...:biggrin:
 
Upvote 0
Meldoc, i thought everone has given up this thread...thank you soo much for writing back.
That was what I was looking for.
Thanks again!

Pedie;)
 
Upvote 0
1 All that's happened is that the Insert button has been pressed. This has nothing to do with VBA it could happen in any application.

2 Don't know what you mean, I've never seen 'relative' used to describe a way of coding - it's more to do with formula I guess.

3 It won't happen automatically in the VBE, all the person is doing is pressing the TAB key to indent the code.

This is a good thing to do as it makes it easier to read and follow the code, and therefore makes it easier for you and other people spot errors.

You might want to look into using Option Explicit as well.

I've got an add-in for indenting but it doesn't do it automatically, unless I'm missing an option/setting.:)
 
Upvote 0
So suppose if I want to move the code to center I have to like tab 8 times??? and there is no shortcut or anything?

Just curious....:biggrin:
 
Upvote 0

Forum statistics

Threads
1,215,768
Messages
6,126,783
Members
449,336
Latest member
p17tootie

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