ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   resize rows and column (https://www.excelbanter.com/excel-programming/329601-resize-rows-column.html)

newbie

resize rows and column
 
hi

how do i resize rows and column so that i can see the whole data in the cell
without doing it manually? i'm using visual basic .net

Noor Faiz[_2_]

resize rows and column
 
Hi,

I am not sure if this is the answer of your query.

Sub TestMyArray()

'Declare array
'But, remember to start it from 1
'So, do not start it from 0

Dim FinalOutput(1 To 2, 1 To 4) As Integer

FinalOutput(1, 1) = 100
FinalOutput(1, 2) = 200
FinalOutput(1, 3) = 300
FinalOutput(1, 4) = 400
FinalOutput(2, 1) = 170
FinalOutput(2, 2) = 270
FinalOutput(2, 3) = 370
FinalOutput(2, 4) = 470

'Call array and paste
Range("b2").Resize(2, 4) = FinalOutput

End Sub


Hope it works.

Regards,

Noor Faiz




"newbie" wrote:

hi

how do i resize rows and column so that i can see the whole data in the cell
without doing it manually? i'm using visual basic .net


ton teuns

resize rows and column
 
Use the Autofit method
Activesheet.Columns.Autofit
Activesheet.Rows.Autofit

With kind regards,
Ton Teuns

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 01:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com