Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Run macro until range ends

Here is the short of the long....

I have an web app that I am trying to input data from an excel sheet. This
excel sheet also acts as a database, so it not only will give me my new info
but keeps that info for future reference.

Is there a way to have a userform as part of the macro that would ask the
user to input the row that they want to start the data import from and in
that same form ask for an end row. With hopes that the result of all of this
would be a macro that would perform its duty only in range that you have
provisioned.

The macro that will be running is going to be moving between the excel sheet
and the web app to copy and paste its data with multiple send keys being used.

I am using excel 2007 and intermediate with VBA and a novice with userforms.

Thanks for all the help in advance!
-Wagz

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Run macro until range ends

Set FirstCell = Application.InputBox( _
prompt:="Select First cell", Type:=8)
Set Lastcell = Application.InputBox( _
prompt:="Select Last cell", Type:=8)
Set MyRange = Range(FirstCell, Lastcell)
For Each cell In MyRange

'enter your code here

Next cell

"wagz" wrote:

Here is the short of the long....

I have an web app that I am trying to input data from an excel sheet. This
excel sheet also acts as a database, so it not only will give me my new info
but keeps that info for future reference.

Is there a way to have a userform as part of the macro that would ask the
user to input the row that they want to start the data import from and in
that same form ask for an end row. With hopes that the result of all of this
would be a macro that would perform its duty only in range that you have
provisioned.

The macro that will be running is going to be moving between the excel sheet
and the web app to copy and paste its data with multiple send keys being used.

I am using excel 2007 and intermediate with VBA and a novice with userforms.

Thanks for all the help in advance!
-Wagz

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Run macro until range ends

Joel-

One of the things that I failed to mention is that the row would 10 cells of
data (6 that would actually be used. I imagine that this changes the
programming?

Sorry-
Eric

"Joel" wrote:

Set FirstCell = Application.InputBox( _
prompt:="Select First cell", Type:=8)
Set Lastcell = Application.InputBox( _
prompt:="Select Last cell", Type:=8)
Set MyRange = Range(FirstCell, Lastcell)
For Each cell In MyRange

'enter your code here

Next cell

"wagz" wrote:

Here is the short of the long....

I have an web app that I am trying to input data from an excel sheet. This
excel sheet also acts as a database, so it not only will give me my new info
but keeps that info for future reference.

Is there a way to have a userform as part of the macro that would ask the
user to input the row that they want to start the data import from and in
that same form ask for an end row. With hopes that the result of all of this
would be a macro that would perform its duty only in range that you have
provisioned.

The macro that will be running is going to be moving between the excel sheet
and the web app to copy and paste its data with multiple send keys being used.

I am using excel 2007 and intermediate with VBA and a novice with userforms.

Thanks for all the help in advance!
-Wagz

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Run macro until range ends

Try something like this


Set FirstCell = Application.InputBox( _
prompt:="Select First cell", Type:=8)
Set Lastcell = Application.InputBox( _
prompt:="Select Last cell", Type:=8)
Set MyRange = Range(FirstCell, Lastcell)

count = 0
For Each cell In MyRange

'enter your code here
count = count + 1
if count = 6 then exit for

Next cell


"wagz" wrote:

Joel-

One of the things that I failed to mention is that the row would 10 cells of
data (6 that would actually be used. I imagine that this changes the
programming?

Sorry-
Eric

"Joel" wrote:

Set FirstCell = Application.InputBox( _
prompt:="Select First cell", Type:=8)
Set Lastcell = Application.InputBox( _
prompt:="Select Last cell", Type:=8)
Set MyRange = Range(FirstCell, Lastcell)
For Each cell In MyRange

'enter your code here

Next cell

"wagz" wrote:

Here is the short of the long....

I have an web app that I am trying to input data from an excel sheet. This
excel sheet also acts as a database, so it not only will give me my new info
but keeps that info for future reference.

Is there a way to have a userform as part of the macro that would ask the
user to input the row that they want to start the data import from and in
that same form ask for an end row. With hopes that the result of all of this
would be a macro that would perform its duty only in range that you have
provisioned.

The macro that will be running is going to be moving between the excel sheet
and the web app to copy and paste its data with multiple send keys being used.

I am using excel 2007 and intermediate with VBA and a novice with userforms.

Thanks for all the help in advance!
-Wagz

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
Error Not Displaying, Instead macro just ends J@Y Excel Programming 5 August 15th 07 03:48 PM
named dynamic range that ends with first text entry mcmanusb Excel Worksheet Functions 5 October 12th 06 05:33 AM
Can VBA tell a user a macro is running until it ends? weisenb_stev Excel Programming 3 June 22nd 06 08:23 PM
update links when Macro ends Gato Excel Programming 0 February 21st 06 07:09 PM
PasteSpecial xlPasteFormats ends macro itarnak Excel Programming 4 October 12th 05 02:44 PM


All times are GMT +1. The time now is 10:11 PM.

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

About Us

"It's about Microsoft Excel"