Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Setting Header from Range using VBA?

Status
Not open for further replies.

baltman

Technical User
Joined
Mar 5, 2002
Messages
1,578
Location
US
I want to set Excel's header to be a set range e.g. a1:i2 using VBA and apply it across dozens of sheets where the values of a1:i2 are different.

1. What's the right syntax? I'm trying what I though should work and it doesn't (I'm automating from VFP).

2. When doing this manually from the pagesetup sheet tab, if multiple sheets are selected, the printrange and header range textboxes are disabled. Is this by design of a result of a funky Excel install?

3. I'm thinking that my code, which as a mention, looks like it should work, may be getting rejected due to whatever is causing the textboxes to be disabled. If this is by design, under what conditions are they enabled?

Thanks,
Brian
 
Sorry guys,

I meant to post to forum707, VBA Visual Basic for Applications, but if anyone can help I'd appreciate it [smile]
 
Brian

I'm automating from VFP).

So? Do you need a VFP or a VB Solution? Either way, record a macro in Excel, and if you need it in VB, your good to go and if its VFP it needs tweaking.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Mike,

One would think that copied (and modified for VFP) code would work, but the code is spurned by Excel.

When I issue a .visible=.t. and try to do it manually the textbox where you'd do it via the menu is disabled.

Something with the automation creates a condition where Excel just doesn't let you access the function.

As I said, I meant to post in the MS VBA forum cause I thought those guys might have a better clue.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top