View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default New to programming Excel from VB 2005

in case you are unaware, there is a macro recorder in Excel. You can turn
it on and apply the conditional formatting manually, then turn off the macro
recorder and look at what is recorded.

It will usually do

Range("A1").Select
Selection.Validata . . .

because that is what you physically did. You can eliminate the paired
select selection. Just use it to get some insight into the syntax and
objects/arguments involved.

--
Regards,
Tom Ogilvy


"Stephen Plotnick" wrote in message
...
I figured this with dumb luck:)

osheet.Rows("1").RowHeight = 40
osheet.Columns("A").ColumnWidth = 26
osheet.Range("B:ALN").ColumnWidth = 15
osheet.Range("A1:AZ1").WrapText = True
osheet.Rows("4").Hidden = True

Now to figure the conditional formatting in Excel 2007
"Stephen Plotnick" wrote in message
...
Tom,

THanks; now here is my frustration.

When I started VB programming (COBOL programmer forever) the help via
google and books made the learning curve easier.

Now I'm trying to create a spreadsheet from VB and simple things are
impossible to find. I did find the object you were talking about and can
see all these functions but how am I to know what does what?

Here is some code I wrote to build cells in a spreadsheet. THe building
of the cells works but the hide row does not. I'm probably not even using
the correct command to hide a row. In my program I want to hide row 4.

osheet.Range(MultiLetter & "4").Value = Mid(line, dept_no
* 32 + 1, 32).ToString
osheet.Range(MultiLetter & "4").EntireColumn.AutoFit()
osheet.Range(MultiLetter & "5").Value = Mid(line, dept_no
* 32 + 1, 32).ToString
osheet.Range(MultiLetter & "5").EntireColumn.AutoFit()
End If
Next dept_no

osheet.Rows.Hidden(4) = True

Sorry about the frustration. I just wish there was a book that had all
the command and what they did along with their syntax.

So you don't think I'm nuts in the example above.. THere is data I build
in row three that I'm going to want to use the new conditional
formatting. I want an up arrow or down arrow in row three based on the
value going down looking at row 5. I'm cheating by putting the value in
row 5 also in row 4 and subsequently hiding row 4. This way the user will
only see on arrow in row three and the one in 4 is hidden (that shows the
other arrow).

Thanks,
Steve
"Tom Ogilvy" wrote in message
...
Look in the Object browser in the VBE. Use the Help file in the VBE.

--
Regards,
Tom Ogilvy



"Stephen Plotnick" wrote:

I just started a new project and with lots of reading on internet and
some
help from another newsgroup I feel I'm getting the hang of this.

My question is I can not find a list of all the commands available
within VB
for working with excel spreadsheets. I'm using Excel 2007 and am able
to
take text files and parse fields to put into individual cells. I am
able to
save the spreadsheet and even send the spreadsheet via outlook.

Is there any books or link to webpage to help with the available
commands?

THanks,
Steve