View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] MichaelJohnson168@hotmail.com is offline
external usenet poster
 
Posts: 2
Default Deleting a range after selecting a sheet

I have a button on a worksheet that when pressed is supposed to:

1. Go to another worksheet in the same workbook
2. Select a range of cells in that worksheet
3. Delete the selected range of cells

However I am getting the following error message:

"Select method of Range class failed" when the code executes --
Range(selRange).Select--

Can someone inform me of how I can fix this? Thanks in advance


The code segemnt is below

------------------------------------
selEnd = readRow - 1

selRange = "A" + Trim(Str(selBegin))

selRange = selRange + ":" + "F" + Trim(Str(selEnd))

Sheets("Shared Emp Master Sheet").Select

Range(selRange).Select <- ERROR OCCURS HERE

Selection.Delete Shift:=xlUp
------------------------------------