[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Jason Keats

3/24/2011 3:27:00 AM

I've been experimenting with unicode in VB6. So far I've just used
Timosoft's EditControls - that is, an alternative textbox. While this seems
to work okay, it would be a big job replacing all the controls on a couple
of hundred forms with alternative controls because, unfortunately, I can't
just do a search and replace on the source because the two textboxes have
different properties. I'm guessing it's the same for the other controls.

So, to make things easier I'll probably have to go with a commerical package
that makes it easier to "upgrade".

Below are "suites" of controls that I know of. I would like to hear anything
good/bad anyone has to say about any of them (or others).

Hexagora
http://www.hexagora.com/en_dw_u...

TimoSoft
http://www.timosoft-so...
Free. Under development.

UniControls_2008-06-19.zip by Vesa Piittinen (aka Merri)
http://www.vbforums.com/showthread.php?p=3261531#p...
Experimental, unsupported, no longer under development.

UniSuite
http://www.cyberac...

UniToolbox
http://www.iconico.com/Un...


Thanks.


18 Answers

Jefgorbach

2/9/2010 6:06:00 PM

0

On Feb 9, 10:50 am, Opal <tmwel...@hotmail.com> wrote:
> Thank you Don....
>
> Is this a function that I put into the VBA project?
> How do I call it on the work sheet.
>
> What I mean by rank, is I need to find the
> last row of data on the sheet (once a week)
> and rank the values in the range as these will
> change week by week - I update weekly
> via pivot table.

Sounds like you're new to macros so I'll step thru this from the very
beginning.
From your worksheet, press Alt+11 to bring up the macro/vba editor
then cut/paste everything below my dashed line there.
To run it, press alt+F from your worksheet and choose to run
MacroTryThis.

Rather than risk messing up your data, it first copies your first
worksheet to a new tab named Ranked Values, then selects of all of the
cells, sorting ("ranking") column B from smallest to largest
("ascending").
---------------------------------------------------------
Sub MacroTryThis()
'delete the "Ranked Values" worksheet if it already exists
Application.DisplayAlerts = False
On Error Resume Next
Worksheets("Ranked Values").Delete
Application.DisplayAlerts = True
On Error GoTo 0

'copy sheet1 to a new tab then name it Ranked Values
Sheets("Sheet1").Select
Sheets("Sheet1").Copy After:=Sheets(1)
ActiveSheet.Name = "Ranked Values"

'sort ("rank") column B from smallest to largest
Cells.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

'end with the cursor at cell B2
Range("B2").Select
End Sub

Opal

2/9/2010 8:07:00 PM

0

But I need to rank a row of data

B2 to B.......

Your example looks like it will rank a column
not a row.... am I mistaken?

Jefgorbach

2/9/2010 10:53:00 PM

0

On Feb 9, 3:07 pm, Opal <tmwel...@hotmail.com> wrote:
> But I need to rank a row of data
>
> B2 to B.......
>
> Your example looks like it will rank a column
> not a row.... am I mistaken?

Correct, data is typically arranged vertically in columns (ie B2:B#).
for example:

column A column B
Date Sales
1-01-2010 14
1-02-2010 5
1-03-2010 15
1-04-2010 22

On the other hand, if your data is arranged horizontally across a row
(ie: A6:G6 for instance) then give this a try:
for example

date






Sub MacroTryThis2()
'delete the "Ranked Values" worksheet if it already exists
Application.DisplayAlerts = False
On Error Resume Next
Worksheets("Ranked Values").Delete
Application.DisplayAlerts = True
On Error GoTo 0
'copy sheet1 to a new tab then name it Ranked Values
Sheets("Sheet1").Select
Sheets("Sheet1").Copy After:=Sheets(1)
ActiveSheet.Name = "Ranked Values"

'presuming Column(A) is your longest one, start at its bottom and look
upwards until we find the last row of your data
LastRow = Range("A65536").end(xlup).row

'sort ("rank") across the last row of data smallest to largest
(ascending)
Rows(LastRow).Sort Key1:=Range("A6"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight,
_
DataOption1:=xlSortNormal

'end with the cursor at cell B2
Range("B2").Select
End Sub



Opal

2/10/2010 7:00:00 PM

0

Hmmmm compile error:

"Function call on left-hand side of assignment must return Variant or
Object"

BTW, data has been arranged in this manner:


Weekof Part A Part B Part C
01/04-01/09 6.7 5.4 3.2
01/11-01/16 7.1 4.9 5.1
01/18-01-23 6.3 6.1 8.2

I need to rank the data week by week

If I switch it to the way you first suggested I will eventually run
out of columns
as the part numbers range from 11 to 28 depending on the production
line but
the weeks in a year or years will continue to grow.

ralph

3/24/2011 11:53:00 AM

0

On Thu, 24 Mar 2011 14:26:42 +1100, "Jason Keats"
<jkeats@melbpcDeleteThis.org.au> wrote:

>I've been experimenting with unicode in VB6. So far I've just used
>Timosoft's EditControls - that is, an alternative textbox. While this seems
>to work okay, it would be a big job replacing all the controls on a couple
>of hundred forms with alternative controls because, unfortunately, I can't
>just do a search and replace on the source because the two textboxes have
>different properties. I'm guessing it's the same for the other controls.
>
>So, to make things easier I'll probably have to go with a commerical package
>that makes it easier to "upgrade".
>
>Below are "suites" of controls that I know of. I would like to hear anything
>good/bad anyone has to say about any of them (or others).
>

I can't help with the controls as I've never used any of them. Also
the decision of what control suite to purchase is so completely
dependent on the needs of YOUR application and YOUR budget, not sure
anyone can help other that say "I don't like such 'n such, or such 'n
such worked for me".

As for the actual process of "upgrading" your application - after
years of converting, porting, and refactoring programs I can suggest
that modifying even "a couple of hundred forms" is seldom as daunting
as it may first appear with the use of a good Programmer's Editor (one
that provides for keystroke macros, program macros, and multiple
buffers). All such tasks can broken-down into a few dozen discrete
actions which can be done quickly. It seldom takes as long as one
might think - computers are darn good at mindless substitutions over
and over again. <g>

-ralph

Jim Mack

3/24/2011 2:06:00 PM

0

Mayayana wrote:
> I can't help with advice, but I'm curious. You're doing
> this for speed? I'd be interested to hear, if you or
> anyone else runs tests, as to how much improvement
> can be expected.

More likely to allow complete worldwide language support.

--
Jim
[Support Wisconsin!]
http://www.cafepress.com/2050i...

Mayayana

3/24/2011 2:43:00 PM

0

I can't help with advice, but I'm curious. You're doing
this for speed? I'd be interested to hear, if you or
anyone else runs tests, as to how much improvement
can be expected.



(nobody)

3/24/2011 3:59:00 PM

0

Jason Keats wrote:
> I've been experimenting with unicode in VB6. So far I've just used
> Timosoft's EditControls - that is, an alternative textbox. While this
> seems to work okay, it would be a big job replacing all the controls
> on a couple of hundred forms with alternative controls because,
> unfortunately, I can't just do a search and replace on the source
> because the two textboxes have different properties. I'm guessing
> it's the same for the other controls.

If you open the FRM file with Notepad and check the list of controls, you
will find that VB only lists non-default properties, and properties
containing binary data are referred to the FRX file, like "Form1.frx":1234.
So it's easy to do Find & Replace as long as you don't see references to FRX
files for that control. Here is an example of one of my projects:

Begin VB.TextBox Text1
Height = 375
Left = 3600
TabIndex = 1
Text = "*.*"
Top = 360
Width = 1455
End

Here is an example that is using a binary property(in this case, it's Text
property because this is a multiline TextBox):

Begin VB.TextBox Text1
Height = 1575
Left = 360
MultiLine = -1 'True
TabIndex = 0
Text = "Form1.frx":0006
Top = 240
Width = 3975
End

So to replace the control with something else, just change "VB.TextBox"
above to the new control, such as "UniBox.UniTextBox", and the control would
have the same position and size as the previous control! If there are binary
properties, I recommend that you delete the value using the VB IDE and save
the project, and then view the FRM file in Notepad to see that the reference
to the FRX file is removed. So it's easy to write a parser and replace all
controls quickly.

A safer way is to make an Add-in and loop through all controls, deleting the
older ones, and adding the new ones. There are samples on the web and Planet
Source Code, but if you have never written an Add-in before, writing a
parser might be easier to do.

As for the source code, you will have to do it manually. I recommend that
you use MZToolz Find command because it lists all the results in one window,
including the number of matches, and it can exclude commented code.


Joe Jordan

3/24/2011 10:16:00 PM

0

I'll vouch for the UniSuitePlus controls. It's an extensive suite and all
controls are combined into one OCX, improving ease of distribution.

The author still actively supports the product and responds to issues and
feature requests quickly. I've worked with him for several months getting
various issues ironed out with the basic controls, and they're working well
now. With an embedded manifest, the controls will use the native modern OS
styling; very nice for controls like ListView, where the native VB6 version
looks absolutely ancient these days.

Before UniSuitePlus, I tried UniToolbox. It's less of a code rewrite but the
author has essentially abandoned development, and does not offer the modern
look that UniSuitePlus provides. I also gave Hexagora a quick try before
being turned off by bugs and the high cost.

Joe Jordan

"Jason Keats" <jkeats@melbpcDeleteThis.org.au> wrote in message
news:jSyip.13815$MF5.7020@viwinnwfe02.internal.bigpond.com...
> I've been experimenting with unicode in VB6. So far I've just used
> Timosoft's EditControls - that is, an alternative textbox. While this
> seems to work okay, it would be a big job replacing all the controls on a
> couple of hundred forms with alternative controls because, unfortunately,
> I can't just do a search and replace on the source because the two
> textboxes have different properties. I'm guessing it's the same for the
> other controls.
>
> So, to make things easier I'll probably have to go with a commerical
> package that makes it easier to "upgrade".
>
> Below are "suites" of controls that I know of. I would like to hear
> anything good/bad anyone has to say about any of them (or others).
>
> Hexagora
> http://www.hexagora.com/en_dw_u...
>
> TimoSoft
> http://www.timosoft-so...
> Free. Under development.
>
> UniControls_2008-06-19.zip by Vesa Piittinen (aka Merri)
> http://www.vbforums.com/showthread.php?p=3261531#p...
> Experimental, unsupported, no longer under development.
>
> UniSuite
> http://www.cyberac...
>
> UniToolbox
> http://www.iconico.com/Un...
>
>
> Thanks.
>
>

Jason Keats

3/25/2011

0


"Jim Mack" <no-uce-ube@mdxi.com> wrote in message
news:1aCdnWe_9L580hbQnZ2dnUVZ_u2dnZ2d@giganews.com...
> Mayayana wrote:
>> I can't help with advice, but I'm curious. You're doing
>> this for speed? I'd be interested to hear, if you or
>> anyone else runs tests, as to how much improvement
>> can be expected.
>
> More likely to allow complete worldwide language support.

That is correct, Jim. It has nothing to do with speed.