VBA excel problem with one code line

H

hans.joachim.klotz

Hi

Following code doesn't work like my idea.


====================
Sub Makro8()

' Makro8 Makro
' Makro am 30.10.2005 von - - aufgezeichnet
' Wählt den Bereich von A2 bis zur letzen Zelle mit Inhalt aus. Ist
falsch 17:12:2005'

Range("A2").CurrentRegion.Select

End Sub
====================

The code mark the range from A1 and not from A2. The end is OK.


In a book for VBA Excel Handbook for WIN I red following code

Worksheets(2).[b2].CurrentRegions is a Range Objekt with all cells
starting from B2

My code fundamental is OK, it comes no error message

Can someone help me ?

Is there a big differnece between VBA for WIN and OS X ?

I haven't found no OS X specific VBA Forum..

Thanks

Jochen (.de)
 
J

JE McGimpsey

Following code doesn't work like my idea.


====================
Sub Makro8()

' Makro8 Makro
' Makro am 30.10.2005 von - - aufgezeichnet
' Wählt den Bereich von A2 bis zur letzen Zelle mit Inhalt aus. Ist
falsch 17:12:2005'

Range("A2").CurrentRegion.Select

End Sub
====================

The code mark the range from A1 and not from A2. The end is OK.

The CurrentRegion property includes a range surrounding the target cell
on *all* sides until it's bounded by blank rows and columns. So if you
have a value in a row 1 cell, row 1 will be included, as long as there's
not a blank column that separates the row 1 cell from the target cell.
In a book for VBA Excel Handbook for WIN I red following code

Worksheets(2).[b2].CurrentRegions is a Range Objekt with all cells
starting from B2

My code fundamental is OK, it comes no error message

Can someone help me ?

What is it that you're trying to do?

If you want to exclude column 1 and row 1 from the current region, one
way is:

Intersect(Range("A2").CurrentRegion, Range("2:" & Rows.Count)).Select

but there may be better ways, depending on your worksheet layout.
Is there a big differnece between VBA for WIN and OS X ?

MacVBA (both OSX and previous) are VBA5, which is also the version for
WinXL97 VBA. More recent WinXL versions use VBA6. There are additional
commands in VBA6 (such as Replace, Join, Split, Round). There are also a
few relatively minor differences in syntax, primarily with I/O functions
(for instance, the GetSaveAsFilename method's FileFilter argument).
I haven't found no OS X specific VBA Forum..

There is none - this microsoft.public.mac.office* newsgroup hierarchy is
the place.
 
H

hans.joachim.klotz

@JE McGimpsey

Thanks for your answer.

I will read your text but.
I need some time because my english is not so good.
If I have additional question I will ask here later.

Jochen (.de)
 
H

hans.joachim.klotz

My aim is following

I will (must) create a lot of diagramms

The values are not stored from A1 : H2350.
In reality the values are stored from A15 : H2350 in one sheet or A15 :
H1330 or A15 : H4370 and so on.
The first values also in the same cell the last values are in different
cells.

I'm not an expert in VBA so I have simple questions

Jochen (.de)
 
H

hans.joachim.klotz

Heeeeeeeeyyyy

I found the solution with your answer.

I insert a blank line before the row A15 : A15

The I can start in A15 and the code marked the range A15 : H2350

Jochen (.de)
 

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