VBA copying and pasting data always into the empty cell after the previously filled one

Palucci

Banned user
Joined
Sep 15, 2021
Messages
138
Office Version
  1. 365
Platform
  1. Windows
Hello Guys !
Maybe it will be easier on an example than in the name of the topic. I have tables where I paste data every month using a macro. However, I would like it to automatically paste into blank spaces. For example, in this msc pasted into the T column in a month it automatically detected empty position in the U columns . Is it possible ?
1632298451245.png

Rich (BB code):
wb.Sheets("analysis-tabele").Range("B21:B35").Copy
wbMe.Sheets("blank3").Range("T2").PasteSpecial Paste:=xlPasteValue
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Do you mean every month to next empty column? Then try this
wbMe.Sheets("blank3").Cells(2, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial Paste:=xlPasteValue
 
Upvote 0
Solution
When im trying put this
Rich (BB code):
wbMe.Sheets("analysis-tabele").Range("B68").Copy
wbMe.Sheets("blank36").Cells(2, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial Paste:=xlPasteValue

I getting error about "Subsrcipt out of range"
But I have a question, how to set a macro to make entries wbMe.Sheets("analysis-tabele").Range("B68").Copy in
T2 and so, for example, the next .Range("B69") position in T3 to the empty next place etc.
 
Upvote 0
Your sheet name is correct blank36, not blank3?
 
Upvote 0
Your sheet name is correct blank36, not blank3?
My fault, it is 3 but we missed "s" wbMe.Sheets("blank3").Cells(2, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial Paste:=xlPasteValue that why i got error
 
Upvote 0
When im trying put this
Rich (BB code):
wbMe.Sheets("analysis-tabele").Range("B68").Copy
wbMe.Sheets("blank36").Cells(2, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial Paste:=xlPasteValue

I getting error about "Subsrcipt out of range"
But I have a question, how to set a macro to make entries wbMe.Sheets("analysis-tabele").Range("B68").Copy in
T2 and so, for example, the next .Range("B69") position in T3 to the empty next place etc.
You meant
B68 > T2
B69 > T3
B70 > T4

on same sheet. Maybe you can record macro how transpose is done?
 
Upvote 0

Forum statistics

Threads
1,215,454
Messages
6,124,931
Members
449,195
Latest member
Stevenciu

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