Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Would like the macro to read:
Go to first blank cell in column, then copy the information from the row above into the first blank row, without specifing the row number in the macro, so that it remains flexible, thank you. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hi Trixie, I'm assuming you have some knowledge of using macros from the wording of your question. Try the below code (adapted from Bob Phillip's post, http://www.excelforum.com/showthread.php?t=500529): Sub CopyToFirstBlankRow() Dim LastRow As Long LastRow = ActiveSheet.Cells(rows.Count, "A").End(xlUp).Row ActiveSheet.Range("A" & LastRow).EntireRow.Copy ActiveSheet.Range("A" _ & LastRow + 1) End Sub fyi, Bob didn't include "activesheet." on his post but it appears that I need it in my setup of Excel (not sure why?). The above copies the entire row, if you only want some info copied (eg col's A to L) try changing the copy line to something like: ActiveSheet.Range("A" & LastRow & ":L" & LastRow).Copy _ ActiveSheet.Range("A" & LastRow + 1) hth Rob Brockett NZ Always learning & the best way to learn is to experience... -- broro183 ------------------------------------------------------------------------ broro183's Profile: http://www.excelforum.com/member.php...o&userid=30068 View this thread: http://www.excelforum.com/showthread...hreadid=524172 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you so much for your reply, it works very well and is much appreciated.
"broro183" wrote: Hi Trixie, I'm assuming you have some knowledge of using macros from the wording of your question. Try the below code (adapted from Bob Phillip's post, http://www.excelforum.com/showthread.php?t=500529): Sub CopyToFirstBlankRow() Dim LastRow As Long LastRow = ActiveSheet.Cells(rows.Count, "A").End(xlUp).Row ActiveSheet.Range("A" & LastRow).EntireRow.Copy ActiveSheet.Range("A" _ & LastRow + 1) End Sub fyi, Bob didn't include "activesheet." on his post but it appears that I need it in my setup of Excel (not sure why?). The above copies the entire row, if you only want some info copied (eg col's A to L) try changing the copy line to something like: ActiveSheet.Range("A" & LastRow & ":L" & LastRow).Copy _ ActiveSheet.Range("A" & LastRow + 1) hth Rob Brockett NZ Always learning & the best way to learn is to experience... -- broro183 ------------------------------------------------------------------------ broro183's Profile: http://www.excelforum.com/member.php...o&userid=30068 View this thread: http://www.excelforum.com/showthread...hreadid=524172 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hi Trixie, Thanks for the feedback, pleased I could help. Rob Brockett NZ Always learning & the best way to learn is to experience... -- broro183 ------------------------------------------------------------------------ broro183's Profile: http://www.excelforum.com/member.php...o&userid=30068 View this thread: http://www.excelforum.com/showthread...hreadid=524172 |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
No problem thank you for answering. I am a beginner at this but am lucky
enough to know exactly what I require. I am looking for other basic codes too e.g. highlight the row the cursor is in (and spell check, or find specific words)... Would you happen to know where I can find the basics? I struggle with the command - in the active cell / row. Also, the macros made the spreadsheet rather large is there any way I can recude the size? Thanks heaps. "broro183" wrote: Hi Trixie, Thanks for the feedback, pleased I could help. Rob Brockett NZ Always learning & the best way to learn is to experience... -- broro183 ------------------------------------------------------------------------ broro183's Profile: http://www.excelforum.com/member.php...o&userid=30068 View this thread: http://www.excelforum.com/showthread...hreadid=524172 |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() This post was EXACTLY what I was looking for.. Although I am pretty new to excel and am having some problems. I did it to run but it is not going to the first blank cell, is it going to the first blank cell at the bottom and copying and filling. Is there a way to change that? Basically what I have and need to do is.. Row1 = "Blah" Then the next 500 rows under that column are empty. Row 501 = "SomethingElse" Then blank rows until whatever.. I need something to fill in 2-500 with "Blah" Then 502-whatever with "SomethingElse" I hope that takes sense, from reading the post about this.. That is what it is suppose to do but I can't get it to work. I just jumps to the very bottom and starts and skips all the blank rows above it. Any help would be so greatly appreciated, I have been messing with this for hours and I need to get it done tonight.. -- kevinz ------------------------------------------------------------------------ kevinz's Profile: http://www.excelforum.com/member.php...o&userid=32759 View this thread: http://www.excelforum.com/showthread...hreadid=524172 |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hi " I am a beginner..." Me too, but I love the challenge! To highlight the row the cursor is in, have a look at: http://excelforum.com/showthread.php?t=520284 For spellcheck/find, I'd suggest starting by recording a macro of your actions so that you have some code to modify/adapt. " I struggle with the command - in the active cell / row. " With regards to what? The macro below shouldn't have made much of a difference to file size. How large is "rather large"? Try going to the last row, selecting all the rows underneath it & then using the menus edit-delete (not the delete key as this just clears the cell contents) and repeating this with the empty columns at the right of your sheet.Also, the link below seems to have quite a few suggestions re file size: http://www.ozgrid.com/forum/showthread.php?p=88327 Some other sources of info for optimising macros/worksheets: http://www.mvps.org/dmcritchie/excel/getstarted.htm (good for beginners) http://www.cpearson.com/excel/optimize.htm http://www.ozgrid.com/VBA/SpeedingUpVBACode.htm www.decisionmodels.com hth Rob Brockett NZ Always learning & the best way to learn is to experience... Trixie Wrote: No problem thank you for answering. I am a beginner at this but am lucky enough to know exactly what I require. I am looking for other basic codes too e.g. highlight the row the cursor is in (and spell check, or find specific words)... Would you happen to know where I can find the basics? I struggle with the command - in the active cell / row. Also, the macros made the spreadsheet rather large is there any way I can recude the size? Thanks heaps. -- broro183 ------------------------------------------------------------------------ broro183's Profile: http://www.excelforum.com/member.php...o&userid=30068 View this thread: http://www.excelforum.com/showthread...hreadid=524172 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excell-How to add the number of cells containing text? = a sum | Excel Worksheet Functions | |||
Sum cells by fill colour | Excel Discussion (Misc queries) | |||
Number format exactly the same, displays differently in some cells | Excel Discussion (Misc queries) | |||
Copy down - special to fill only the blank cells | Excel Discussion (Misc queries) | |||
Fill cells from non-adjacent cells | Excel Discussion (Misc queries) |