Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Don is offline
external usenet poster
 
Posts: 21
Default Help with this?

I have a list of numbers, starting in C2. The below snipit sends the cell
values to a webpage and the user selects the starting row to send out to the
web page, usually C2, but could be any row in the list.

Item #
1932
27029
27073
27382
28087
28227
29142
29195
29299
29302
29321
29488
29498


Snipit:

For i = 0 To response
SendKeys ActiveCell.Value
SendKeys "{TAB}"
Application.Wait (Now + TimeValue("0:00:01"))
ActiveCell.Cells(2, 1).Select
Next i

"response" is determined by user (how many rows to send to web page, i.e.,
10). Now, the problem is, even though the user selects the starting point,
the above code selects the next cell down. I've even put
"activecell.cells(0,1).select" and "activecell.cells(1,1).select" above the
FOR statement. The "0,1" of course goes up to the "ITEM#" which failes on
the search page on web and the "1,1" has no effect.

Can anyone help?

Thanks,
Don


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Help with this?

If response was 10, then i = 0 to response would loop 11 times. should your
loop go from 1 to response rather than 0 to response?

--
Regards,
Tom Ogilvy


"Don" wrote:

I have a list of numbers, starting in C2. The below snipit sends the cell
values to a webpage and the user selects the starting row to send out to the
web page, usually C2, but could be any row in the list.

Item #
1932
27029
27073
27382
28087
28227
29142
29195
29299
29302
29321
29488
29498


Snipit:

For i = 0 To response
SendKeys ActiveCell.Value
SendKeys "{TAB}"
Application.Wait (Now + TimeValue("0:00:01"))
ActiveCell.Cells(2, 1).Select
Next i

"response" is determined by user (how many rows to send to web page, i.e.,
10). Now, the problem is, even though the user selects the starting point,
the above code selects the next cell down. I've even put
"activecell.cells(0,1).select" and "activecell.cells(1,1).select" above the
FOR statement. The "0,1" of course goes up to the "ITEM#" which failes on
the search page on web and the "1,1" has no effect.

Can anyone help?

Thanks,
Don



  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Don is offline
external usenet poster
 
Posts: 21
Default Help with this?

actually, Tom, with this, 1 to 10 loops 9 times. 0 to 10 loops 10
times....but, that isn't the real problem. the real problem is that it skips
that 1st cell and starts with next. For example, I select 1932, but the code
skips this and pulls in 27029. I need it to start in the cell where it's
been manually selected.

Don

"Tom Ogilvy" wrote in message
...
If response was 10, then i = 0 to response would loop 11 times. should
your
loop go from 1 to response rather than 0 to response?

--
Regards,
Tom Ogilvy


"Don" wrote:

I have a list of numbers, starting in C2. The below snipit sends the cell
values to a webpage and the user selects the starting row to send out to
the
web page, usually C2, but could be any row in the list.

Item #
1932
27029
27073
27382
28087
28227
29142
29195
29299
29302
29321
29488
29498


Snipit:

For i = 0 To response
SendKeys ActiveCell.Value
SendKeys "{TAB}"
Application.Wait (Now + TimeValue("0:00:01"))
ActiveCell.Cells(2, 1).Select
Next i

"response" is determined by user (how many rows to send to web page,
i.e.,
10). Now, the problem is, even though the user selects the starting
point,
the above code selects the next cell down. I've even put
"activecell.cells(0,1).select" and "activecell.cells(1,1).select" above
the
FOR statement. The "0,1" of course goes up to the "ITEM#" which failes on
the search page on web and the "1,1" has no effect.

Can anyone help?

Thanks,
Don





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Help with this?

I couldn't reproduce it:

running your snipped

Sub CCC()
response = 10
Range("C2").Select
For i = 0 To response
'SendKeys ActiveCell.Value
'SendKeys "{TAB}"
Application.Wait (Now + TimeValue("0:00:01"))
Debug.Print i, ActiveCell.Value
ActiveCell.Cells(2, 1).Select
Next i

End Sub

Produced:
0 1932
1 27029
2 27073
3 27382
4 28087
5 28227
6 29142
7 29195
8 29299
9 29302
10 29321

which is 11 loops with C2 inlcuded. Since you are getting something
different, your problem isn't with the code you show, but something else -
perhaps other code or your environment.

If you are working with the ActiveCell, it is unclear how it is sending it
to a web page, but perhaps that interaction is the problem.

--
Regards,
Tom Ogilvy




"Don" wrote:

actually, Tom, with this, 1 to 10 loops 9 times. 0 to 10 loops 10
times....but, that isn't the real problem. the real problem is that it skips
that 1st cell and starts with next. For example, I select 1932, but the code
skips this and pulls in 27029. I need it to start in the cell where it's
been manually selected.

Don

"Tom Ogilvy" wrote in message
...
If response was 10, then i = 0 to response would loop 11 times. should
your
loop go from 1 to response rather than 0 to response?

--
Regards,
Tom Ogilvy


"Don" wrote:

I have a list of numbers, starting in C2. The below snipit sends the cell
values to a webpage and the user selects the starting row to send out to
the
web page, usually C2, but could be any row in the list.

Item #
1932
27029
27073
27382
28087
28227
29142
29195
29299
29302
29321
29488
29498


Snipit:

For i = 0 To response
SendKeys ActiveCell.Value
SendKeys "{TAB}"
Application.Wait (Now + TimeValue("0:00:01"))
ActiveCell.Cells(2, 1).Select
Next i

"response" is determined by user (how many rows to send to web page,
i.e.,
10). Now, the problem is, even though the user selects the starting
point,
the above code selects the next cell down. I've even put
"activecell.cells(0,1).select" and "activecell.cells(1,1).select" above
the
FOR statement. The "0,1" of course goes up to the "ITEM#" which failes on
the search page on web and the "1,1" has no effect.

Can anyone help?

Thanks,
Don






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



All times are GMT +1. The time now is 06:27 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"