Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some code which copies and pastes for a few differnet places how can i
paste from the next blank row |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
This finds the cell below the last entry in column A Lastrow = Cells(Cells.Rows.Count, "a").End(xlUp).Row + 1 If you don't know hich column the last used row is in then use this LastRow = UsedRange.Rows.Count + 1 Mike "Miree" wrote: I have some code which copies and pastes for a few differnet places how can i paste from the next blank row |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thats worked thanks, could you maybe also tell me what i would have to do to
then get it to paste from column b not a, i tried just changing the "a" to "b" but didnt work "Mike H" wrote: Hi, This finds the cell below the last entry in column A Lastrow = Cells(Cells.Rows.Count, "a").End(xlUp).Row + 1 If you don't know hich column the last used row is in then use this LastRow = UsedRange.Rows.Count + 1 Mike "Miree" wrote: I have some code which copies and pastes for a few differnet places how can i paste from the next blank row |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Lastrow = Cells(Cells.Rows.Count, "B").End(xlUp).Row + 1 The line of code can go in a worksheet module and then it will return the last line from that sheet. If you put it in a general module it will return the last line from the active sheet. Change it to this Lastrow = Sheets("Sheet3").Cells(Cells.Rows.Count, "B").End(xlUp).Row + 1 and it will return sheet3 no matter where you put it. Mike "Miree" wrote: Thats worked thanks, could you maybe also tell me what i would have to do to then get it to paste from column b not a, i tried just changing the "a" to "b" but didnt work "Mike H" wrote: Hi, This finds the cell below the last entry in column A Lastrow = Cells(Cells.Rows.Count, "a").End(xlUp).Row + 1 If you don't know hich column the last used row is in then use this LastRow = UsedRange.Rows.Count + 1 Mike "Miree" wrote: I have some code which copies and pastes for a few differnet places how can i paste from the next blank row |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The first copy and paste is working ok, pasting below my headings, but when i
put a second set of code after it pastes over the exsiting pasted data. Still neither will paste starting from column B. "Mike H" wrote: Hi, Lastrow = Cells(Cells.Rows.Count, "B").End(xlUp).Row + 1 The line of code can go in a worksheet module and then it will return the last line from that sheet. If you put it in a general module it will return the last line from the active sheet. Change it to this Lastrow = Sheets("Sheet3").Cells(Cells.Rows.Count, "B").End(xlUp).Row + 1 and it will return sheet3 no matter where you put it. Mike "Miree" wrote: Thats worked thanks, could you maybe also tell me what i would have to do to then get it to paste from column b not a, i tried just changing the "a" to "b" but didnt work "Mike H" wrote: Hi, This finds the cell below the last entry in column A Lastrow = Cells(Cells.Rows.Count, "a").End(xlUp).Row + 1 If you don't know hich column the last used row is in then use this LastRow = UsedRange.Rows.Count + 1 Mike "Miree" wrote: I have some code which copies and pastes for a few differnet places how can i paste from the next blank row |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Post your code
"Miree" wrote: The first copy and paste is working ok, pasting below my headings, but when i put a second set of code after it pastes over the exsiting pasted data. Still neither will paste starting from column B. "Mike H" wrote: Hi, Lastrow = Cells(Cells.Rows.Count, "B").End(xlUp).Row + 1 The line of code can go in a worksheet module and then it will return the last line from that sheet. If you put it in a general module it will return the last line from the active sheet. Change it to this Lastrow = Sheets("Sheet3").Cells(Cells.Rows.Count, "B").End(xlUp).Row + 1 and it will return sheet3 no matter where you put it. Mike "Miree" wrote: Thats worked thanks, could you maybe also tell me what i would have to do to then get it to paste from column b not a, i tried just changing the "a" to "b" but didnt work "Mike H" wrote: Hi, This finds the cell below the last entry in column A Lastrow = Cells(Cells.Rows.Count, "a").End(xlUp).Row + 1 If you don't know hich column the last used row is in then use this LastRow = UsedRange.Rows.Count + 1 Mike "Miree" wrote: I have some code which copies and pastes for a few differnet places how can i paste from the next blank row |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The first copy and paste i do works(but still strts pasting from column A),
but when i add a second set of code exactlly the same, but a different source it copys over the first data set instead of going to the next line. "Mike H" wrote: Hi, This finds the cell below the last entry in column A Lastrow = Cells(Cells.Rows.Count, "a").End(xlUp).Row + 1 If you don't know hich column the last used row is in then use this LastRow = UsedRange.Rows.Count + 1 Mike "Miree" wrote: I have some code which copies and pastes for a few differnet places how can i paste from the next blank row |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find Blank Line | Excel Programming | |||
How do you add a blank line automatically after the Subtotal line | Excel Worksheet Functions | |||
Insert Blank Line | Excel Discussion (Misc queries) | |||
If cell is not blank, then line out row | Excel Worksheet Functions | |||
Next blank line | Excel Programming |