Færdiggjort

VBA Loops To Copy Ten Sets of Data

Hello,

Can you please help with this Excel VBA code. I have data that updates once a minute. The following code works to copy a line of that data, every minute, and paste it on sequential rows for analysis later. There are two key values.

Data Set Number: There is one value copied to A3 that designates the data set. Data Set 1 provides 24 minutes of data, with minutes counting down from 24 to 0. Then A3 increments to 2 (data set two) and another 24 minutes of data is displayed on rows A6:AQ6. This continues with ten data sets.

Minute Number: The value in A4 counts down from 24 to 0 and that value moves the row down one at a time. Once Data Set 1 is done, Data Set 2 begins and A4 begins counting down from 24 to 0 again.

I am asking for Do Loops and/or other code to have Data Sheet One's 24 rows of data to be copied to Sheet 1, Data Sheet Two's 24 rows of data to be copied to Sheet 2, and so on. There are 10 sets of data per day, so 10 sheets per workbook. The attached file shows what it looks like on one sheet.

Critical: After the Data Sheet 1 is complete and the row of data corresponding to minute zero is entered, the code needs to detect that data from data sheet 2 is starting (by noting A3=2) and begin to copy the rows of data onto sheet 2. The code exits once the Data Set 10, Minute 0 is reached and copied.

By the way, the reason I'm using the Worksheet Calculate Function is because the data comes over the internet and the Worksheet Change Event doesn't detect the changing values.

I'm using this code one data set at a time. This project will help with efficiency. Future projects associated with this project will surely come. In approximately 1 month, I will have too much information and will need help with lookup functions in closed worksheets/workbooks.

Thank you in advance,

Dennis

Private Sub Worksheet_Calculate()

'Declaring a variable called rng that will be used to capture the first row

Dim rng As Range

'A4 has a calculation in it and the worksheet is updating every minute

Set Target = Range("A4")

'Ensure target is a number

If IsNumeric(Target) Then

'Stop any possible runtime errors and halting code

On Error Resume Next

'Turn off ALL events so the Target not loop

[login to view URL] = False

Set rng = Range("A6:P6")

If [login to view URL] >= 0 And [login to view URL] <= 24 Then

Range("A6:P6").Copy Destination:=[login to view URL](35 - [login to view URL])

Else

Range("F1").Select

End If

'Turn events back on

[login to view URL] = True

'Allow run time errors again

On Error GoTo 0

End If

End Sub

Evner: Visual Basic

Se mere: what is a copy, vba with, updating resume, starting with visual basic, set data, off by one errors, need help with resume, help with resume, functions in excel vba code, event run down, copy of resume, what is vba in excel, what is vba, vba time, vba for, vba error, in vba, excel vba with, excel vba or, excel vba help

Om arbejdsgiveren:
( 6 bedømmelser ) Abingdon, United States

Projekt ID: #1164758

Tildelt til:

cheungkc

Hi My proposal in PM please

$35 USD in 2 dage
(6 bedømmelser)
3.1

10 freelancers are bidding on average $34 for this job

mrbrave

See PMB for details please.

$35 USD på 1 dag
(94 bedømmelser)
6.1
Krusche

Please check your PMB

$30 USD på 1 dag
(23 bedømmelser)
5.4
ZeusMan

Looking forward to working with you...

$30 USD in 0 dage
(36 bedømmelser)
5.0
ahmedsobherfan

Hi, i am expert in VBA Readt to start working payemnt after job completion Best Regards

$30 USD på 1 dag
(19 bedømmelser)
4.1
valleysoftware

As described. See PMB. Not that worried about "multi-threading". California provider.

$40 USD in 0 dage
(5 bedømmelser)
3.5
microk

Let's start...

$40 USD på 1 dag
(9 bedømmelser)
3.5
milledl

Please see PMB

$30 USD på 1 dag
(1 bedømmelse)
2.0
Hnnghia

I can help you. Contact me as soon as possible. I'm ready now. Check my PM.

$30 USD på 1 dag
(0 bedømmelser)
0.0
stechsun

Lets Start...

$40 USD på 1 dag
(0 bedømmelser)
0.0