HELP me please

Annemus

New Member
Joined
May 22, 2011
Messages
15
Hello
I'm making an assigment for class and got stuck with this..
I have to find the first empty cell in the row, and then copy a specific cell (which changes everyday) into that specific empty cell. My problem is to select the empty row, so I can copy paste the cell into the empty cell. But hwo, then the empty cell is one number??


I have written the following (the problem is coloured with red):


Sub Dagsdata()
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, 1).End(xlUp).Row
Emptyrow = Lastrow + 1
MsgBox Emptyrow

Range("F4").Copy
Range(Emptyrow).Select
Selection.Paste

End Sub

Thanks!!!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Welcome to the board.

You could replace
Code:
Range("F4").Copy
Range([COLOR=red]Emptyrow[/COLOR]).Select
Selection.Paste
with
Code:
Range("F4").Copy Cells(Emptyrow, "A")
 
Upvote 0
Code:
Sub Dagsdata()
    
    Dim Emptyrow As Long
    
    Emptyrow = Cells(Rows.Count, 1).End(xlUp).Row + 1
    MsgBox Emptyrow
    
    Range("F4").Copy Destination:=Rows(Emptyrow)        [COLOR="Green"]'Paste in all cells in the next empty row[/COLOR]
   [COLOR="Green"] 'Range("F4").Copy Destination:=Range("A" & Emptyrow) 'Paste in only Column A in the next empty row[/COLOR]
    
End Sub
 
Upvote 0
Thank you so much!!
Now I can finish the first exercise in my paper..
Thank you.. I am so greatfull for your answers.
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,181
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top