Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filling values to columns
Hi,
I am quite new to Excel programming so this question might seem basic.. I need to add values to consecutive columns and i want to do this automatically. For example i have 5 values that i have to enter to column c,d,e,f,g appropriately. Does anyone know how to do this? Thanks, Hilla |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filling values to columns
Hilla,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Option Explicit Sub TEST_1() Range("C1:G1").Value = Array(1, 2, 3, 4, 5) End Sub Sub TEST_2() Range("C2").Resize(1, 5).Value = Array(10, 20, 30, 40, 50) End Sub Sub TEST_3() Dim RNG As Range Dim N As Integer Set RNG = Range("C3") N = 5 RNG.Resize(1, N).Value = Array(100, 200, 300, 400, 500) End Sub Sub TEST_4() Dim RNG As Range Set RNG = Range("C4") RNG.Resize(1, 5).Value = Array([A1], [B1], [A3], [B4], [A5]) End Sub Sub TEST_5() Dim i As Integer Dim X As Variant X = Array("A8", "A9", "B8", "B9", "B10") For i = 1 To 5 Range("C5")(1, i).Value = Range(X(i - 1)).Value Next End Sub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- Regards, Soo Cheon Jheong _ _ ^ąŻ^ -- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filling values to columns
Hilla
There is a myriad of ways you could do this but you question is not full of detail of what values, is it repeating, etc. Below will do what you ask but suspect it is not a solution that will work for you Sub fillRange() Range("C1:G1").Value = Array(1, 2, 3, 4, 5) End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Hilla" wrote in message m... Hi, I am quite new to Excel programming so this question might seem basic.. I need to add values to consecutive columns and i want to do this automatically. For example i have 5 values that i have to enter to column c,d,e,f,g appropriately. Does anyone know how to do this? Thanks, Hilla |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filling values to columns
Thanks Alot!!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filling In A Column With Incrementing Values ? | New Users to Excel | |||
Filling values in a grid | Excel Worksheet Functions | |||
Add new Worksheet after filling first 256 columns | Excel Programming | |||
Filling a cell with values from another worksheet | Excel Programming | |||
Filling a ComoboBox with Values on a different Worksheet | Excel Programming |