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

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,490
Office Version
  1. 2016
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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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
 

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,490
Office Version
  1. 2016
Platform
  1. Windows
Code:
.offset(1)

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

many thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,130,051
Messages
5,639,773
Members
417,112
Latest member
PachRedoc

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
Top