Marco to Paste data next to a to blank row

UnitedSkysJoey

New Member
Joined
Mar 3, 2017
Messages
6
Hello Mr. Excel members!

I am stumped with a Marco need.

Here is (what I think) is a similar macro I already have:

Sub AddRow5()
'
' Cut_PasteSpecial Macro
'


'
Range("C5:S5").Select
Selection.Copy
Sheets("Presentation for Approval").Select
Range("A1:S1").Select
lMaxRows = Cells(Rows.Count, "A").End(xlUp).Row
Range("A" & lMaxRows + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("AP Formulas").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub

What I need is something that will do almost the exact opposite.

I have a spreadsheet with values in one column. I have another spreadsheet where I want a button that when clicked will return the value from that column next to the first blank row.

Any thoughts on how I can rewrite (or another all new) marco that would get me what I need?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
idk what you data your working with or what im really coding lol but lets say you have column b full and C partially empty.
change to your column names then press F8 to over and over and watch it step through to learn how it works. if your working with a really large file then arrays will be the way to go due to efficiency.

dim lastrow, i as integer
lastrow = range("b2000").end(xlup).row 'assuming you have less than 2000 rows. *change the number if you want.
for i = 1 to lastrow
if range("c" & i).value = "" then
range("C" & i).value = range("B" & i).value
end if
next
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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