Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help with Macro and cell copy

I am a newbie with VBA and Macros and request assistance with a
spreadsheet I am tasked with to complete.

Monthly, I export about 8000 records of lab data from our database and
use it for QA spreadsheets. We now have a new value that management
wwould like to be tracked.

I have created a macro based on one I found on the the internet (sorry
I can't rember the author)to extract the CALCM and PHOS data to a new
sheet. That seems to be working fine for the most part.

What I need to do now is multiply the CALM and PHOS results to come up
with CXP result per patient, if the patient have both a CALCM and PHOS
result for that Lab Date. Notice that a patient could have more than 1
set of results per month. see data below.

Is there a way to make a macro to move PHOS results to Col I so I can
multiply CALM and PHOS or is there a better way to accomplish this?

Also to note, These macros will be performed by normal users so it
should be as user friendly as possible.

<data
A B C D E F G H
Chart# LName FName LabDate Lab result
111111 Lastname1 EMMETT 4/11/2005 CALCM 9.7 AD HEMO
111111 Lastname1 EMMETT 4/11/2005 PHOS 7.4 AD HEMO
111111 Lastname1 EMMETT 4/25/2005 CALCM 9.3 AD HEMO
111111 Lastname1 EMMETT 4/25/2005 PHOS 9.6 AD HEMO
222222 Lastname2 MARTHA 4/11/2005 CALCM 8.7 AD HEMO
222222 Lastname2 MARTHA 4/11/2005 PHOS 2.8 AD HEMO
333333 Lastname3 BETTY 4/11/2005 CALCM 8.2 AD HEMO
333333 Lastname3 BETTY 4/11/2005 PHOS 7.1 AD HEMO
</data

Any Help or insight with will be appreciated.
Thank you.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Help with Macro and cell copy

Maybe you could just use a formula.

With headers in row 1 and data starting in row 2:

=IF(AND(E2="calcm",E3="phos",A2=A3,B2=B3,C2=C3,D2= D3),F2*F3,"")

And drag down.

wrote:

I am a newbie with VBA and Macros and request assistance with a
spreadsheet I am tasked with to complete.

Monthly, I export about 8000 records of lab data from our database and
use it for QA spreadsheets. We now have a new value that management
wwould like to be tracked.

I have created a macro based on one I found on the the internet (sorry
I can't rember the author)to extract the CALCM and PHOS data to a new
sheet. That seems to be working fine for the most part.

What I need to do now is multiply the CALM and PHOS results to come up
with CXP result per patient, if the patient have both a CALCM and PHOS
result for that Lab Date. Notice that a patient could have more than 1
set of results per month. see data below.

Is there a way to make a macro to move PHOS results to Col I so I can
multiply CALM and PHOS or is there a better way to accomplish this?

Also to note, These macros will be performed by normal users so it
should be as user friendly as possible.

<data
A B C D E F G H
Chart# LName FName LabDate Lab result
111111 Lastname1 EMMETT 4/11/2005 CALCM 9.7 AD HEMO
111111 Lastname1 EMMETT 4/11/2005 PHOS 7.4 AD HEMO
111111 Lastname1 EMMETT 4/25/2005 CALCM 9.3 AD HEMO
111111 Lastname1 EMMETT 4/25/2005 PHOS 9.6 AD HEMO
222222 Lastname2 MARTHA 4/11/2005 CALCM 8.7 AD HEMO
222222 Lastname2 MARTHA 4/11/2005 PHOS 2.8 AD HEMO
333333 Lastname3 BETTY 4/11/2005 CALCM 8.2 AD HEMO
333333 Lastname3 BETTY 4/11/2005 PHOS 7.1 AD HEMO
</data

Any Help or insight with will be appreciated.
Thank you.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help with Macro and cell copy

Works like a champ...Thank You

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
How do I copy a macro into another cell? Jango53 Excel Discussion (Misc queries) 0 September 2nd 08 10:05 PM
Is there a macro i can use to copy a cell +1 Bill M. Excel Discussion (Misc queries) 4 February 12th 08 02:59 PM
Using macro to copy a part of a cell content to next cell Charles Excel Discussion (Misc queries) 6 May 31st 06 05:57 AM
Macro help - copy a cell down gjcase Excel Discussion (Misc queries) 3 September 4th 05 05:09 AM
Macro Help to Copy to Last Cell Dave Y[_3_] Excel Programming 4 July 3rd 04 02:05 AM


All times are GMT +1. The time now is 04:31 PM.

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"