Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Starting with A2!

This code insert values in column a,b and d. I would like to start with
cell A2 instead of A1. Please help.

With wbDest.Sheets("Ark1")

For i = LBound(a) To UBound(a)
.Cells(i, "a") = a(i, 1): .Cells(i, "b") = a(i, 2): .Cells(i,
"d") = a(i, 3)
Next


End With

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Starting with A2!

Alen32 wrote:
This code insert values in column a,b and d. I would like to start
with cell A2 instead of A1. Please help.

With wbDest.Sheets("Ark1")

For i = LBound(a) To UBound(a)
.Cells(i, "a") = a(i, 1): .Cells(i, "b") = a(i, 2):
.Cells(i, "d") = a(i, 3)
Next


End With


I think this should work:

dim i As Long, j As Long, k As Long, l As Long
const ROW_START as long = 2

With wbdest.Sheets("Ark1")

j = LBound(a, 1)
k = UBound(a, 1)
l = ROW_START - j
For i = j To k
.Cells(i + l, "a") = a(i, 1)
.Cells(i + l, "b") = a(i, 2)
.Cells(i + l, "d") = a(i, 3)
Next


End With

HTH

Rob


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Starting with A2!

With your code inserting start with cell A10

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Starting with A2!

It works very well
When I copy from here some number one change to l I don't know why.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting with a zero? karyd Excel Discussion (Misc queries) 3 October 6th 08 04:28 AM
Starting add-in using vba utmb[_2_] Excel Programming 1 November 7th 04 02:08 AM
Starting add-in using vba utmb[_3_] Excel Programming 0 November 5th 04 04:51 PM
Starting over TyeJae[_15_] Excel Programming 9 June 17th 04 02:23 AM
Starting a userform upon starting the file Fritznel Excel Programming 1 July 28th 03 05:37 AM


All times are GMT +1. The time now is 05:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"