attn: Gord, one thing I can't figure out!

J

jacob farino

Gord:

That works perfectly, thank-you!!! Now, being the amateur that I am, I don't
see a simple way to alter which column the macro affects (technically, I
need column C to be auto-uppercased), and instead of me screwing around
inside your module, I figured I'd ask.

Jacob
 
D

Dave Peterson

This line:
If Target.Column > 1 Then Exit Sub
says if the thing you changed was in column 1 (A), then do the work.

So a change like:
If Target.Column = 3 Then Exit Sub

Should limit it to just column 3 (C).
 
G

Gord Dibben

Jacob

Make that <> 3

Gord

This line:
If Target.Column > 1 Then Exit Sub
says if the thing you changed was in column 1 (A), then do the work.

So a change like:
If Target.Column = 3 Then Exit Sub

Should limit it to just column 3 (C).
 
D

Dave Peterson

I saw your other follow up post and thought, oh, oh. What did I send?

I was hoping to get here before you!

To the OP, sorry. To Gord, thanks for the correction.

And just to add something...

I like this way:

if intersect(target,me.range("c:c")) is nothing then exit sub
 
G

Gord Dibben

Dave

As you are aware, I am basically a Tools>Options person.

My code writing is very basic and I tend to use pre-packaged code parts from
yours and others.........cribbing?

What ramifications can arise from If Target.Column <> 3 Then Exit Sub

as opposed to your preference?

Gord
 
D

Dave Peterson

I just like that syntax better.

I think it makes it easier to change--especially if it's a multicolumn/multirow
range (not whole columns/rows).

if intersect(target,me.range("b9:d23")) is nothing then exit sub

On the other hand, it should have been easy to change to "<> 3", too! (But I
failed miserably.)

I like to add this check, too:
if target.cells.count > 1 then exit sub
(or do something different based on multiple cells changing).
 

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

Top