Programming Questions? Ask a Programmer for Answers ASAP
Thanks for using JustAnswer. My name isXXXXX will do whatever I can to answer your question
you can upload to
after uploading they give you a download link
paste that link here.
You will find in column F the word Panel.
I need all of those rows to be cut from the current sheet and pasted into a different sheet.
give me a min to download
column F has Right Left
what exactly do you need me to do?
As you scroll down you will see the word Panel. Each line with this word needs be be CUT and pasted into a new or different sheet. The line number and number of lines will change depending on the job.
i see what you are saying
if the row contains "Panel"
it needs to be copied
and all of the rest will be skipped
Correct - except - it needs to be CUT - I need the info on the new sheet but it has to be removed from the current sheet.
You are the man - that's why I come back!!
i will post back with the completed file soon
please stand by
or check back later if you prefer
I'll stick around, it doesn't take you to long.
By the way this has to work on a file that is new every time.
ok, ill just have it generate a new sheet each time it runs
the only thing that will need to be the same
is that word will always need to be in column f
Yes the word will always be the same. I get orders in on spreadsheets so It can't be attached to that particular file.? Clear?
i would assume you would just copy the macro over to each sheet you need
Ok, if you remember - you did one for me a few weeks ago and it would work on the file you tested on but I couldn't get it to work on my sheet.. Each time I will run this macro it will be on a new file. Clearer?
so inotherwords the data will not be on the workbook that this macro is on.
Correct. I will copy into my personal VBA project and run from there.
then this will take some more time
i will try to finish tonite
but if I cant
should be by tomarrow
i will also have to have you define the sheet name
that contains the data
i could do that with a prompt
and you type the sheet name
or put it in a cell
Define the sheet name as "Panels".
if that will always be the same
makes life easier
If it's ok with you, I'll just check back tomorrow.
works for me
speak to you then
It will always be the same.
alright I have all the information I need now
Ok works, but instead of it asking me to select the file I would like it to open - open the file below every time:
Workbooks.Open Filename:= _ "C:\Users\Ray\Desktop\Batch-Lables - Gcode\door lables.xls"
I just recorded a macro to get the above.
I don't know what to replace in your code to make this happen.
Never mind I got it. Great Job. I rate right now.
great thanks for the ratinghere is the new macro hard coded to default to your file.Sub rows_copy() Dim lr As Long Dim cv As String Dim b As Long Dim WS As Worksheet FileToOpen = "C:\Users\Ray\Desktop\Batch-Lables - Gcode\door lables.xls" Workbooks.Open Filename:=FileToOpen Set WS = Sheets.Add Worksheets("Panel").Activate lr = Cells(Rows.Count, "A").End(xlUp).Row b = 1 For a = 1 To lr cv = Range("F" & a).Value If cv = "Panel" Then Rows(a & ":" & a).Select Selection.Copy WS.Activate Range("A" & b).Select Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _ , SkipBlanks:=False, Transpose:=False b = b + 1 Worksheets("Panel").Activate Rows(a & ":" & a).Select Selection.Delete Shift:=xlUp a = a - 1 End If Next MsgBox ("Macro Done:")End Sub