VBA Assistance - copy a selected cell within a specific named range and paste special to another cell

KayWill

New Member
Joined
Jan 22, 2015
Messages
36
I have been viewing different codes over the internet for 4 days and I can't seem to get this to work correctly. I have a named range called "REVBUD" and when selecting any cell within that range, the amount selected is supposed to paste so a table called budget. It does paste but when I go to select another cell, it overwrites and I want it to go to the next row (empty cell). My data is being posted in column "AF" starting at row 2. My codes is as follows:

Code:
Sub SPCpastesel()

RowCount = Worksheets("CoreConSummary").Range("A" & Rows.Count).End(xlUp).Offset(1)

Application.CutCopyMode = False
Selection.Copy

  With Sheets("CoreConSummary")
    Range("Budget[BUDGET]").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
  End With
  
End Sub

If any one could help it would be greatly appreciated as I'm not sure why it's not pasting to the next cell.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I'm not seeing the REVBUD range you refer to. I see the BUDGET range.

It looks like you're very close with the
Code:
.End(xlUp)

Instead of referring only to the "BUDGET" range, try using the
Code:
.End(xlUp)
to figure out the last populated row. You know it's in column AF and that really should be where you'll want to be. Then add 1 to whatever row is the last populated row.

Also, try to get away from using "Select". Select isn't necessary 98% of the time.

Feel free to write back if questions remain.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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