Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Replaceing destination cell contents with new data in Excell

Hi
I am using the following code to replace old data with new.

Set objRange1 =
Application.Workbooks("Analysis.xls").Worksheets(" Data").Range("B2").EntireColumn
Set ObjRange2 =
Application.Workbooks("Analysis.xls").Worksheets(" Data").Range("C2").EntireColumn

objRange1.TextToColumns ObjRange2, , , , , , True

The problem is, unless I do a manual delete on "ObjRange2" then I get the
prompt,

"Do you want to replace the contents of the destination cells?"

I always want to replace and to do programatically. I am using Excel 2000
and Windows 2000.

Thanks, Duane

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Replaceing destination cell contents with new data in Excell

Try

OnError GoTo codeBreak
SetWarnings No

'before your code and at the end of your code put

codeBreak:
SetWarnings Yes

This can be dangerous so be certain to add the second part. The Goto
--
Thanks,

Patrick


"Duane L Kibby" wrote:

Hi
I am using the following code to replace old data with new.

Set objRange1 =
Application.Workbooks("Analysis.xls").Worksheets(" Data").Range("B2").EntireColumn
Set ObjRange2 =
Application.Workbooks("Analysis.xls").Worksheets(" Data").Range("C2").EntireColumn

objRange1.TextToColumns ObjRange2, , , , , , True

The problem is, unless I do a manual delete on "ObjRange2" then I get the
prompt,

"Do you want to replace the contents of the destination cells?"

I always want to replace and to do programatically. I am using Excel 2000
and Windows 2000.

Thanks, Duane

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Replaceing destination cell contents with new data in Excell

Use
application.displayalerts = false
and
application.displayalerts = true

To change whether the prompt is shown. As this is an application level
setting you should be sure to use an error handler to reset the value in case
of a crash.

HTH

"Duane L Kibby" wrote:

Hi
I am using the following code to replace old data with new.

Set objRange1 =
Application.Workbooks("Analysis.xls").Worksheets(" Data").Range("B2").EntireColumn
Set ObjRange2 =
Application.Workbooks("Analysis.xls").Worksheets(" Data").Range("C2").EntireColumn

objRange1.TextToColumns ObjRange2, , , , , , True

The problem is, unless I do a manual delete on "ObjRange2" then I get the
prompt,

"Do you want to replace the contents of the destination cells?"

I always want to replace and to do programatically. I am using Excel 2000
and Windows 2000.

Thanks, Duane

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Replaceing destination cell contents with new data in Excell

Disregard previous...whron app.

Application.DisplayAlerts = False

Application.DisplayAlerts = True

!!Be sure to turn the Alerts back on at the end of you proceedure!!

--
Thanks,

Patrick


"Duane L Kibby" wrote:

Hi
I am using the following code to replace old data with new.

Set objRange1 =
Application.Workbooks("Analysis.xls").Worksheets(" Data").Range("B2").EntireColumn
Set ObjRange2 =
Application.Workbooks("Analysis.xls").Worksheets(" Data").Range("C2").EntireColumn

objRange1.TextToColumns ObjRange2, , , , , , True

The problem is, unless I do a manual delete on "ObjRange2" then I get the
prompt,

"Do you want to replace the contents of the destination cells?"

I always want to replace and to do programatically. I am using Excel 2000
and Windows 2000.

Thanks, Duane

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
Paste contents, but keep formula of destination cynteeuh Excel Discussion (Misc queries) 2 November 19th 09 10:38 PM
Paste data to cell and keep destination font and size billbob New Users to Excel 2 July 10th 09 06:39 PM
How can I Import picture contents into Excell cell array numbers? CLR Excel Worksheet Functions 0 November 29th 06 06:38 PM
How can I Import picture contents into Excell cell array numbers? Hard Nut Excel Worksheet Functions 0 November 29th 06 03:24 PM
Copying format to a new cell, w/o overwriting destination cell contents James C Excel Discussion (Misc queries) 1 October 18th 05 08:02 PM


All times are GMT +1. The time now is 12:25 AM.

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"