New to VBA

Some One Far Away

New Member
Joined
May 23, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello Community,

I am new to the VBA function and seeking help for some problem,

Range("A1").Select

Selection.End(xlDown).Select

Range("A465").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

ActiveWindow.Close

Application.CutCopyMode = False

Range("A1").Select


how can I make the new range an empty cell instead of the specified range bolded. in case of opening and pasting more that one file?

Thank you,
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
If I understand correctly, you are wanting to find the last row used and then go to the next blank row?

VBA Code:
Dim lngRow As Long
Dim strRange as String
lngRow= Cells(Rows.Count, 1).End(xlUp).Row
lngRow = lngRow + 1

strRange = "A" & lngRow

However, I don't think you need to select the cell in order to paste

You should be able to do something like the following

Code:
Range(strRange).PasteSpecial Paste:=xlPasteValues
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,592
Members
449,089
Latest member
Motoracer88

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