Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am writing macro that clears the contents of a spreadsheet. After this is
done the whole spreadsheet is selected (it is blue...). How do I write code so that the spreadsheet is not selected after clear contents is done? -- I am very thankful for any fast assistance! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Samantha,
Try removing selections from your code. If this is a problem for you, post your code. --- Regards, Norman "SamanthaK" wrote in message ... I am writing macro that clears the contents of a spreadsheet. After this is done the whole spreadsheet is selected (it is blue...). How do I write code so that the spreadsheet is not selected after clear contents is done? -- I am very thankful for any fast assistance! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You haven't quoted any of your code, but I'm guessing you've got a
range.select or cells.select in there somewhere so that your code is something like Cells.Select Selection.ClearContents (which is exactly what you would get if you recorded the macro) try Cells.ClearContents I think you will find this fixes it! SamanthaK wrote: I am writing macro that clears the contents of a spreadsheet. After this is done the whole spreadsheet is selected (it is blue...). How do I write code so that the spreadsheet is not selected after clear contents is done? -- I am very thankful for any fast assistance! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
add this line to your code after the clear contents. Range("A1").select 'or select another cell or Cells(1,1).select regards FSt1 "SamanthaK" wrote: I am writing macro that clears the contents of a spreadsheet. After this is done the whole spreadsheet is selected (it is blue...). How do I write code so that the spreadsheet is not selected after clear contents is done? -- I am very thankful for any fast assistance! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear Contents | Setting up and Configuration of Excel | |||
Clear Contents | Excel Discussion (Misc queries) | |||
to clear contents of a spreadsheet | Excel Discussion (Misc queries) | |||
Clear Contents Help | Excel Programming | |||
Clear contents if x is not in the row | Excel Programming |