Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Very simple Select problem?


Now I've got a little more experience I've been revisiting some of th
code I've previously written to try and remove as many of the 'Select
commands as possible. However, can somebody advise why the botto
select statement here does not work? Do I really need to select th
worksheet first before selecting the cell?
Oh, 'StreetBo' is a declared worksheet.

Thanks,

Adrian

With StreetBO
.Range("AP1").Value = "Backouts"
.Range("b1").Copy
.Range("AP1").pastespecial Paste:=xlFormats, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
.Columns.AutoFit
.Range("a2").Select
End Wit

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Very simple Select problem?

Yes, a worksheet needs to be active to select a cell,
otherwise why select the cell?
In code one almost never needs to select a cell as these
are objects that can quite easily be handled in code. Why
would you need to select that cell...the procedure
doesn't use it


With StreetBO
.Range("AP1").Value = "Backouts"
.Range("AP1").Value = .Range("b1").Value
.Columns.AutoFit
End With


Patrick Molloy
Microsoft Excel MVP


-----Original Message-----

Now I've got a little more experience I've been

revisiting some of the
code I've previously written to try and remove as many

of the 'Select'
commands as possible. However, can somebody advise why

the bottom
select statement here does not work? Do I really need to

select the
worksheet first before selecting the cell?
Oh, 'StreetBo' is a declared worksheet.

Thanks,

Adrian

With StreetBO
.Range("AP1").Value = "Backouts"
.Range("b1").Copy
.Range("AP1").pastespecial Paste:=xlFormats,

Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
.Columns.AutoFit
.Range("a2").Select
End With


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Very simple Select problem?

Kobayashi wrote:
Do I really need to select the
worksheet first before selecting the cell?


If the worksheet is not active then you will need to Activate it before
selecting a cell on it. Alternatively you could

Application.Goto .Range("A2")

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Very simple Select problem?

You have missed the "." character from your code:

With StreetBO
.Range("AP1").Value = "Backouts"
.Range("b1").Copy
.Range("AP1").pastespecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
.Columns.AutoFit
.Range("a2").Select
End With


Kobayashi wrote in message ...
Now I've got a little more experience I've been revisiting some of the
code I've previously written to try and remove as many of the 'Select'
commands as possible. However, can somebody advise why the bottom
select statement here does not work? Do I really need to select the
worksheet first before selecting the cell?
Oh, 'StreetBo' is a declared worksheet.

Thanks,

Adrian

With StreetBO
Range("AP1").Value = "Backouts"
Range("b1").Copy
Range("AP1").pastespecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Columns.AutoFit
Range("a2").Select
End With


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Very simple Select problem?


Many thanks to all for trying to help.
This issue is, presumably, why I have difficulty using the .usedrange
function within With statements that use a variable, albeit a worksheet
variable. I always have to end up selecting the worksheet then starting
the with statement as: 'With Activesheet' to get the .usedrange to
work. Both this .used range issue and my below problem must be related,
no?

Patrick,
I want it to be active so that when the workbook is opened by somebody
else the beginning of the worksheet is on view.

Bill,
Afraid I can't get the application.goto... to work either inside or
outside the With statement?

Don,
Thanks, the .range... = .range... is a new idea to me, which I shall
remember and use but how does this resolve me Select issue?

Ginger,

Where have I missed the "."? I checked several times and don't see
where?

Again, many thanks for all your help!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple IF problem Old Timer Excel Discussion (Misc queries) 1 November 7th 06 02:11 AM
Simple problem excelnovice1 New Users to Excel 3 June 29th 06 11:19 AM
another simple problem... London Excel Worksheet Functions 8 July 22nd 05 08:43 PM
Hopefully simple Select Case error Kobayashi[_15_] Excel Programming 3 October 3rd 03 07:46 PM


All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"