last day (16 days later) » 

5:00 AM
hi
 
how's it going
 
not bad
I need some clarification
in your pics, A3 is blank
i assume that's a different sheet
 
right, so it's the other sheet I'm talking about
I might have posted out of order
but the 8x12 grid
 
some hidden rows in that one
walk me through the process
you "Insert Name Here" which is B2
then what is meant to happen
 
give me a second to take full screen shots of the pages
would make more sense
 
5:04 AM
k
you would benefit from using the OR operator
 
LOL. I thought of that half way through this and I'm so mentally exhausted I figured I would do it later. Makes zero sense I know, but seemed okay at the time
wait, how do i send a ss in this chat
ah well
oka
don't have 100rep
 
If idCell.Interior.Color = RGB(204, 204, 255) Or idCell.Interior.Color = RGB(255, 153, 0) Or idCell.Interior.Color = RGB(255, 153, 204) Or idCell.Interior.Color = RGB(204, 255, 255) Then
With rrWS.Range("A1").Offset(rrWS.Rows.count - 1, 0).End(xlUp).Offset(1, 0)
.Value = idCell.Value
idCell.Copy
.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
rrWS.Range("B1").Offset(rrWS.Rows.count - 1, 0).End(xlUp).Offset(1, 0) = idCell.Address
End With
End If
ah, just post it to imgur?
 
but anywho.. Sheet 1 = where info gets put.

the 2nd pic you send with 8x12 grid.. the information populates in each corresponding square starting with A3
so in reality, all 94 of those squares A3-H12 will be filled with names
and it will then be used for data review
where results are given based on color
then, on the 1st pic you sent
the macro automatically pulls in the colored information
with the names and color
 
still confused, let me re-read that
so E6 is to print A3
 
i updated my post with pics
 
5:11 AM
E6 in the 2nd screenshot says "Insert Name Here"
but it should read the value of A3?
@deLa Thanks
 
just random information. tbh. Where "insert name here" is will be covid patients names
I'm trying to make this to speed up the resulting process a bit
values = patients name
A3 is coming from the grid I made myself
 
ok, that is the missing link lol
 
where on the left is A-H
lol good. i know it's pretty sloppily set up to begin with too
 
why are you using idCell.Address
it seems like it is a placeholder?
 
think of that A-H 1-12 grid as this belart.com/poxygrid-96-place-test-tube-rack.html
literally just a representation of that
 
5:16 AM
If idCell.Interior.Color = RGB(204, 204, 255) Or idCell.Interior.Color = RGB(255, 153, 0) Or idCell.Interior.Color = RGB(255, 153, 204) Or idCell.Interior.Color = RGB(204, 255, 255) Then
idCell.Copy
With rrWS.Range("A1").Offset(rrWS.Rows.count - 1, 0).End(xlUp).Offset(1, 0)
.Value = idCell.Value
.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
End With
rrWS.Range("B1").Offset(rrWS.Rows.count - 1, 0).End(xlUp).Offset(1, 0) = idCell.Address
End If
 
N pos, s pos, orf pos, and ms2 are all accounts of a specimen needing rerun
 
you had a reference inside the with
that shouldnt have been there
Which sheet is A3 on?
 
so if a cell is colored with those colors, we need to pull them out of that metal rack. and it's so much nicer to know where exactly they are on the metal rack rather than aimlessly looking through 96 specimens
rack1
 
I think you are putting the cart before the horse
with the formatting
i can see a bit of it in your code
lets backtrack a sec
this is the debugging/scrutinizing portion of the chat :)
 
sorry, i uploaded wrong pic into my post. i just updated again.
okay, lol
 
5:21 AM
what portion of the spreadsheet is user fed data?
I assume Patients
 
just the "Patient info copy-paste"
yep
 
so rack1 holds what data?
 
a total of 96 patients
 
Patient info copy-paste: A2
 
a full covid run = 384 patients
 
5:22 AM
Patient info copy-paste: B2
 
reasoning for the 4 racks
 
sample data?
trying to wrap my head around it
 
no data goes on this document. simply a tracking tool
we have another program that analyzes the data that we look at
 
you said it is the user fed portion of the workbook
ah ok
so you drop it in
Patient info copy-paste is a dump sheet
 
yes
exactly
 
5:24 AM
(lived that many times before) lol
ok
 
lmao
 
are you able to give me a sample piece of data that would go in A2:F2
i'm a visual person :)
if it is sensitive, make it different but similar
 
i am too, haha I get it
yeah give me 1 second
 
k
 
however, i'm going to confuse you more. There's 1 caveat
well does Rack1-Rack4 and the whole run of 384 make sense?
 
5:27 AM
not at all :P
 
lolol
me neither
;)
a total of 94 patients get pasted Under RACK1 RACK2 RACK3 and RACK4 on "Patient info copy-paste".

those patients populate to their corresponding RACK1 RACK 2 RACK 3 RACK 4 worksheets - populating in A3-H12 in sequential order

A1-A2 are where we run our positive and negative controls. SO no patients in those.
HOWEVER, on RACK 2, RACK 3, and RACK 4. a patient COULD be in A1 which is why my "rField.Range("C6:N13")
so for what you asked
not a real person nor is it real information for them
well, i'm sure its a real person but not their information
 
lol, k
so
based on that
wait now
Rack 1 is populated
shouldnt that info be in patient info?
 
yes
 
let's have a look at that page :)
 
i just wrote out a realistic example and then copied down
 
5:38 AM
And A1 / A2 of Rack 1 is empty
 
ah ok
 
A1 and A2 are occupied by quality controls.
 
so rack 2 would have the same info down the page that would populate the Rack 2 sheet
 
yes
 
5:39 AM
gotcha
clicking now
 
WE'RE DOING IT MAN
 
:D
so in that one, it isn't pulling the data
safe to say?
 
i didn't have anything there
yeah
 
ok
sec
 
only had that demo "Insert name here" typed in
 
5:41 AM
so it would start at 3 then go to 12, then repeat?
down to c7
over to n7
 
yep
looking at that
the top left corner = A1 on my excel
goes left to right
when it hits A12
goes to B1
so actually not quite what you were saying
 
ie, c7
i get it
the whole thing now :)
hold tight
 
!!!
awesome
last image im gonna spam you with. https://imgur.com/a/KwlGuyB

So in a real situation, all the "Miller, Angela" names will be completely separate patients. that last ss i sent you, i highlighted some random cells, indicating that specimen needs to be rerun. So we have to physically go to that blue metal rack, and find that specimen to send it back through the process.
the reasoning for the c.address is for knowing exactly where that test tube location is on the blue rack
which is identical to the RACK1 worksheet and so on
 
k, hold tight
 
and voila, you're trained in covid resulting
np
 
5:49 AM
lololol
will there always only be 94?
94 slots
2 QC
 
you got it
 
94 samples*
 
yep
 
k
 
QC always in A1 & A2
 
5:49 AM
having static numbers helps
where did 384 come from?
 
so after we have 4 racks fully pipetting. We put them on one of those 384 plates
94patients+2QC per rack
4 total racks
96*4 = 384
 
makes sense
now we are cooking
 
that's what i'm talking about!
if it makes you feel better. You caught on a hell of a lot quicker, with minimal visuals, than people I'm training right now
kudos :)
 
lolol thanks
i'm thinking quick and dirty
 
the name of the game
 
5:54 AM
but then again, I am the kind of person that doesn't like doing that lol
 
hahah
 
I made a photoshop image today for my wife, wanted so badly to perfect it but she wanted it to look like a paint image
hurt my soul
 
a straight kick in the nards
 
my emotion nards :D
 
"do you understand the amount of time this takes?!"
 
5:56 AM
there were wisps of hair that I wanted to put over top of the image I was dropping in
oh well lol
 
my wife has kinda been the same with this excel document. I've been working on it all week trying to roughly learn VBA from my brief knowledge of java..it's been constant trying to make it as perfect as it can be.

Her response is "looks good enough"
omggg
the extreme detail
but very respectable
2 weeks ago, the most advanced excel skills I had was like.. the average function. I've been so hesitant to post stuff on here because of my very little excel knowledge, but the couple posts I did make people have been freaking awesome. Seems like a great community
 
lol nice
stack overflow has it's ups and downs
got it populating
 
!!
how so?!
 
you'll see soon :)
double loops
 
that's what my brain feels like right now
 
6:11 AM
lol, its just past 3am here, I know mushy brains
I get it
 
you a night crawler as well i take it? lol
 
lol yeah
 
I'm also just realizing the code I posted on my post, was the loop for 1 rack. However, every Rack worksheet grid starts in the same spot..so it should just be minor changes to input onto the other racks
im interested to take a look at the code
and honestly, I cannot thank you enough for this.
you're incredible, i greatly appreciate it
you code for a living? or just something to pass the time?
 
I'll look after the other racks too :)
NP, just doing my part :P
I am a programmer but unfortunately lost my job
I did teach myself everything I know
see now i am trying to do the fancy thing
lol
 
oh shit, i'm sorry to hear that. I came damn close to that as well until I literally fell into this job. I hope it turns around for you. I think it's safe to say there's a very small percentage of people in the world who would be devoting this amount of time to a random person on the internet at 3am lol
 
6:27 AM
thanks. I've been applying but it seems everyone wants the ABCDEFG of languages
I do what I can :D
 
Keep at it. You're obviously a great communicator..getting the info you need to solve a problem about a subject, I'm assuming, was completely random, lol. Something will turn up
 
thanks. fingers crossed :)
 
mine are as well!
and btw, i pasted my full macro
just hadn't added the idCell.address for the last 3 loops yet
and if you need it/if it helps, these are the other rack name/location cells on the "Reruns To Pull" workset
 
lets see how this code works:
haven't dim'd everything yet
Sub test()
Dim src As Worksheet: Set src = Worksheets("PATIENT INFO COPY-PASTE")
Dim dest As Worksheet

lastRow = src.Cells(src.Rows.count, "A").End(xlUp).Row

Set dest = Worksheets("Rack 1")


For i = 1 To lastRow
If i = 1 Then
rownum = 6
colnum = 5
Else
colnum = colnum + 1
End If
If i = 11 Or i = 23 Or i = 35 Or i = 47 Or i = 59 Or i = 71 Or i = 83 Then
colnum = 3
rownum = rownum + 1
End If
dest.Cells(rownum, colnum) = src.Cells(i + 1, 1)
Next i
End Sub
lets just see how that runs
i actually redid it since telling you about the double loop
 
sorry dogs barking, brb 2 min
okay
as far as my existing code, am i replacing it with that first loop?
er wait
 
6:47 AM
you will like this
i think
knowing there are always 94
we can eliminate lastRow
and i just added the loop in for all 4 racks
will there ever be more racks?
 
nope, always 4 for a run
 
k
easy
Option Explicit

Sub test()
Dim src As Worksheet: Set src = Worksheets("PATIENT INFO COPY-PASTE")
Dim dest As Worksheet
Dim i As Long
Dim n As Long
Dim rowNum As Integer
Dim colNum As Integer

For n = 1 To 4
Set dest = Worksheets("Rack " & n)
For i = 1 To 94
If i = 1 Then
rowNum = 6
colNum = 5
Else
colNum = colNum + 1
End If
If i = 11 Or i = 23 Or i = 35 Or i = 47 Or i = 59 Or i = 71 Or i = 83 Then
colNum = 3
rowNum = rowNum + 1
End If
dest.Cells(rowNum, colNum) = src.Cells(i + 1, n)
Next i
Next n
i hate how this formats the code to have no indents lol
 
lol, i hate how i'm following some of it, but then i start seeing variables and =, giving me flashbacks to middle school math
 
lolol
Option Explicit

Sub test()
Dim src As Worksheet: Set src = Worksheets("PATIENT INFO COPY-PASTE")
Dim dest As Worksheet
Dim i As Long
Dim n As Long
Dim rowNum As Integer
Dim colNum As Integer

Application.ScreenUpdating = False

For n = 1 To 4
Set dest = Worksheets("Rack " & n)
For i = 1 To 94
If i = 1 Then
rowNum = 6
colNum = 5
Else
colNum = colNum + 1
End If
If i = 11 Or i = 23 Or i = 35 Or i = 47 Or i = 59 Or i = 71 Or i = 83 Then
colNum = 3
rowNum = rowNum + 1
End If
dest.Cells(rowNum, colNum) = src.Cells(i + 1, n)
 
okay, I think i get it
 
6:52 AM
Application.ScreenUpdating makes it so you don't see the code running
it just runs then updates the screen
does it work for you needs?
let me add some comments to it
 
omg, im so dumb right now
so like all my code i have on the post
is all the same macro
 
was a learning experience ;)
you would replace that with this
 
throw your variables in at the top
 
thats a personal preference
 
Sub generateRR()
Dim rField As Range
Dim r2Field As Range
Dim r3Field As Range
Dim r4Field As Range
Dim idCell As Range
Dim r1WS As Worksheet
Dim rrWS As Worksheet
Dim r2WS As Worksheet
Dim r3WS As Worksheet
Dim r4WS As Worksheet

Set r1WS = Worksheets("RACK 1")
Set r2WS = Worksheets("RACK 2")
Set r3WS = Worksheets("RACK 3")
Set r4WS = Worksheets("RACK 4")
Set rField = r1WS.Range("C6:N13")
Set r2Field = r2WS.Range("C6:N13")
Set r3Field = r3WS.Range("C6:N13")
Set r4Field = r4WS.Range("C6:N13")
Set rrWS = Worksheets("Reruns To Pull")
it makes sense to be to have it inside the With/endwith
crap thats just all my stuff
 
6:59 AM
lol
Option Explicit

Sub test()
Dim wb As Workbook: Set wb = ThisWorkbook
Dim src As Worksheet: Set src = wb.Worksheets("PATIENT INFO COPY-PASTE")
Dim dest As Worksheet
Dim i As Long
Dim n As Long
Dim rowNum As Integer
Dim colNum As Integer

'prevent the screen from updating
Application.ScreenUpdating = False

'n is the Rack number. Loop 4 times (4 racks)
For n = 1 To 4
'set the destination for the data (ex: Worksheets("Rack 1")
Set dest = wb.Worksheets("Rack " & n)
'loop through each of the 94 samples
commented each line to help you learn
 
so for the 'set the destination for the data
 
it sets the worksheet to paste to
 
meaning, where its pulling the info from or where the A3 etc. number should populate
 
it will always pull from PATIENT INFO COPY-PASTE
and will be a variable destination
in this case, 1 - 4
 
okay so it sounds like
ok here's one of my loops:
' color search and sheet (rrWS) the name/color should populate
If idCell.Interior.color = RGB(204, 204, 255) Then
With rrWS.Range("A1").Offset(rrWS.Rows.Count - 1, 0).End(xlUp).Offset(1, 0)

' strictly just the copy/pasting to my "Reruns to Pull" worksheet(rrWS)
.Value = idCell.Value
idCell.Copy
.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
End With
so from what i'm understanding
you have replaced that copy and paste part
turning it into
If idCell.Interior.color = RGB(204, 204, 255) Then
With rrWS.Range("A1").Offset(rrWS.Rows.Count - 1, 0).End(xlUp).Offset(1, 0)
just that
 
7:10 AM
sort of
i've eliminated the if requirement
not necessary
and the offset isnt necessary either
using the iteration of the loop, i know what needs to go where
so i can just assign the cell rather than start with one cell then go 1 cell around it
    dest.Cells(rowNum, colNum) = src.Cells(i + 1, n)
that reads
    workbooks(Thisworkbook).Worksheets("Rack n").Cells(rowNum, colNum) = workbooks(Thisworkbook).Worksheets("PATIENT INFO COPY-PASTE").Cells(i + 1, n)
n is the rack number
it iterates through in the first loop
the second loop, i, iterates the sample
so it loops through each sample in each rack and puts it in the corresponding worksheet
does that make sense?
does it work with your data?
 
ahhhhh
okay, i'm picking up what you're putting down
 
one of my favorite sayings lol
 
haha, yeah at least get where you're coming from now I think it'll work once I fiddle. Again man, can't thank you enough!
 
np
 
I have to go to sleep its approaching 2:30 for me and I've been staring at this screen for far too long lol. if I have any questions tomorrow I might shoot you a message
take care!
 
7:19 AM
lol almost 430 here
i'll give you my email
let me know how you make out
best of luck
 
will do! and thanks, again!
go to sleep!
haha
 
lol will do. peace
 
later
 

  last day (16 days later) »