'--
Sub SkipSome()
Dim vAcrossTop As Variant
Dim vColumns As Variant
Dim N As Long
vAcrossTop = Array("Alabama", "Alaska", " Arizona ", "Arkansas", _
"California", "Canada")
vColumns = Array(1, 2, 3, 5, 6, 10)
For N = LBound(vColumns) To UBound(vColumns)
Cells(1, vColumns(N)).Value = vAcrossTop(N)
Next
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)
<(E-Mail Removed)>
wrote in message
Thanks for the reply but I need to skip some columns in between. For
example, A1, B1, C1, E1, F1, J1...
Any idea?
Thanks.
Cathy
On Feb 15, 1:18 am, "Jim Cone"
wrote:
> Here is an example of one way to fill a row with data.
> You can expand it to as many elements (cells) as needed.
> '--
> Dim vAcrossTop as Variant
> vAcrossTop = Array("Alabama", "Alaska", " Arizona ", "Arkansas", " California")
> Range("A1:E1").Value = vAcrossTop
> --
> Jim Cone
> San Francisco, USA
> http://www.realezsites.com/bus/primitivesoftware
> (Excel Add-ins / Excel Programming)
>
> <cathywoodf...@personainternet.com>
> wrote in message
> Hi. I have inherited a huge macro from someone and now I'm trying to
> manipulate it to suit my needs. I want to insert 2 rows at the top
> of a spreadsheet and insert values into cells A1:AV1 and A2:AV2. I
> would like to follow the same coding techniques as the original coder
> so that it all looks the same. Here is a sample of code where he
> assisgned column names to each column. I would like to do the same
> but with cell's instead.
> -snip-
> Hope someone can help. Thanks,
> Cathy