Range("x65536").End(xlUp).Select - easy but can't remember ;)

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,604
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have this code...
Code:
Sub test()
Sheets("sheet1").Select
Range("x14").Select
Selection.Copy
Sheets("graphs").Select
Range("x65536").End(xlUp).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Application.CutCopyMode = False
    Selection.NumberFormat = "d-mmm-yy"
    Selection.Font.Size = 8

End Sub

I want the next available cell chosen in row X but my code keeps selecting the last cell populated and I can't remember how to select the next available cell.

Hellllllllp !!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try

Code:
Sub test()
Sheets("sheet1").Range("x14").Copy
With Sheets("graphs").Range("x" & Rows.Count).End(xlUp).Offset(1)
    .PasteSpecial Paste:=xlValues
    Application.CutCopyMode = False
    .NumberFormat = "d-mmm-yy"
    .Font.Size = 8
End With
End Sub
 
Upvote 0
Code:
.offset(1)

ahhh I remember now..and thanks for tidying up my simple code

many thanks
 
Upvote 0

Forum statistics

Threads
1,224,508
Messages
6,179,189
Members
452,893
Latest member
denay

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