Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change Column Width
#1
hi all, is there a way to change the width of a column?

like in Excel to make the columns wider or smaller with a macro?

Thanks
#2
guess its impossible

Thanks anyway

if u find a way to do it tho, plz post

Thanks again
#3
Please be a little more specific and maybe give an example. Are you using QM Dialog or HTML? What you are asking should be able to be done but be more specific.
#4
I just want to know how to like change a whole columns width in Excel

like double the width of column A or something
#5
I would really like to learn to do this

so anyone that knows even a little bit how to do this
could maybe post an example code
just to change the column width, i think it might be changing it in pixels
im not exactly sure

Thanks
#6
Do you want something like this? It changes the column with of a new Excel workbook.

Macro
Code:
Copy      Help
int w1=act(win("Microsoft Excel -" "XLMAIN"))
lef+ 96 155 w1
lef- 203 155 w1

OR

Do you want something like this? It changes the column with of a new Excel workbook no matter where Excel is located on the screen.

Macro
Code:
Copy      Help
int w1=act(win("Microsoft Excel -" "XLMAIN"))
lef+ 96 33 child("" "EXCEL7" w1)
lef- 161 35 child("" "EXCEL7" w1)
#7
Yes that is basicaly what i want

but is there a way to do it without clicks (lef)
#8
In Excel you can record it. Use Excel's recording (menu Tools -> Macro ....). It records Excel macro, like this:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2008.07.06 by G
'
' Keyboard Shortcut: Ctrl+y
'
ActiveCell.FormulaR1C1 = "dd"
Range("A2").Select
Columns("A:A").ColumnWidth = 34
End Sub

Excel macros can be launched from QM or converted to QM.
#9
Or this will work as well

Macro
Code:
Copy      Help
Acc ColumnA=acc("" "CLIENT" win("Microsoft Excel -" "XLMAIN") "EXCEL7" "" 0x1001)
ColumnA.Mouse(1 59 10)

Acc Width=acc("Width..." "MENUITEM" win("Microsoft Excel -" "XLMAIN") "" "" 0x1001)
Width.DoDefaultAction

act win("Microsoft Excel -" "XLMAIN")

str SizeOfColumnA.getwintext(id(19 win("Column Width" "bosa_sdm_XL9")))
VARIANT NewSizeOfColumnA

NewSizeOfColumnA.mul(SizeOfColumnA 2)
_s=NewSizeOfColumnA; _s.setwintext(id(19 win("Column Width" "bosa_sdm_XL9")))

Acc PushButtonOk=acc("OK" "PUSHBUTTON" win("Column Width" "bosa_sdm_XL9") "bosa_sdm_XL9" "" 0x1001)
PushButtonOk.DoDefaultAction

Now you have two examples.
#10
sorry that is still not it
that makes the mouse move

i want the mouse to stay in the exact same place the whole time it moves the column

but thanks anyway


Forum Jump:


Users browsing this thread: 1 Guest(s)