Paste value into first blank row in column range?

kylesom

New Member
Joined
Aug 5, 2009
Messages
37
Hi - I have a simple timesheet set up that includes a search function that returns a job number to cell A45.

I'd like to add a VBA macro button to automatically copy that job number in A45 and pastespecial (value only) into the first blank cell (counting from the top) in column A in the range A8:A38.

Am sure its pretty simple to do, but I've no idea where to start...any help appreciated!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Something like this (untested)
Code:
Sub a()
dim Last_Row as Long
Last_Row = Workshetfunction.Max(8,Range("A39").End(xlUp).Offset(1).Row
Range("A" & Last_Row).Formula = Range("A45").Value
End Sub
 
Upvote 0
Something like this (untested)
Code:
Last_Row = Workshetfunction.Max(8,Range("A39").End(xlUp).Offset(1).Row

Hi - thanks for the try but the line quoted is flagged in the the VBA editor as a Compile Error: Expected list seperator or ).
 
Upvote 0
Oops - that's what I get for typing code straight onto the message board, without using Excel. It should be
Last_Row = WorksheetFunction.Max(8, Range("A39").End(xlUp).Offset(1).Row)
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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