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

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,575
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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

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,575
Office Version
  1. 365
Platform
  1. Windows
Code:
.offset(1)

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

many thanks
 

Forum statistics

Threads
1,175,947
Messages
5,900,498
Members
434,833
Latest member
lulubalisa

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