Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Numberformat

HI,

Code below works fine. Now I would like to make a small adjustment. The
activecell.value needs to be changed from 612345678 to 00612-345678 without
actually changing the format in the cell.

Dim MyData As DataObject
Set MyData = New DataObject
MyData.Clear
MyData.SetText "0" & ActiveCell.Offset(0, 0).Value
MyData.PutInClipboard

Thankx in advance.

Basta
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Numberformat

activecell.numberformat = "00000-00000"

Sam

"Basta1980" wrote:

HI,

Code below works fine. Now I would like to make a small adjustment. The
activecell.value needs to be changed from 612345678 to 00612-345678 without
actually changing the format in the cell.

Dim MyData As DataObject
Set MyData = New DataObject
MyData.Clear
MyData.SetText "0" & ActiveCell.Offset(0, 0).Value
MyData.PutInClipboard

Thankx in advance.

Basta

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Numberformat

Hi Sam,

Thanx for helping. The actual numberformat is clear i.e. not the problem.
What I would like to do is just copy the value to clipboard in desired
numberformat without actually changing the value in Excel. Wit the code below
I get 0612345678, but the value in Excel remains 612345678.

Regards,

Basta

"Sam Wilson" wrote:

activecell.numberformat = "00000-00000"

Sam

"Basta1980" wrote:

HI,

Code below works fine. Now I would like to make a small adjustment. The
activecell.value needs to be changed from 612345678 to 00612-345678 without
actually changing the format in the cell.

Dim MyData As DataObject
Set MyData = New DataObject
MyData.Clear
MyData.SetText "0" & ActiveCell.Offset(0, 0).Value
MyData.PutInClipboard

Thankx in advance.

Basta

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Numberformat

I see!

dim MyStr as string
MyStr = format(activecell.value, "00000-00000"

Sam

"Basta1980" wrote:

Hi Sam,

Thanx for helping. The actual numberformat is clear i.e. not the problem.
What I would like to do is just copy the value to clipboard in desired
numberformat without actually changing the value in Excel. Wit the code below
I get 0612345678, but the value in Excel remains 612345678.

Regards,

Basta

"Sam Wilson" wrote:

activecell.numberformat = "00000-00000"

Sam

"Basta1980" wrote:

HI,

Code below works fine. Now I would like to make a small adjustment. The
activecell.value needs to be changed from 612345678 to 00612-345678 without
actually changing the format in the cell.

Dim MyData As DataObject
Set MyData = New DataObject
MyData.Clear
MyData.SetText "0" & ActiveCell.Offset(0, 0).Value
MyData.PutInClipboard

Thankx in advance.

Basta

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Numberformat

Hi Sam,

Thanx for helping. The actual numberformat is clear i.e. not the problem.
What I would like to do is just copy the value to clipboard in desired
numberformat without actually changing the value in Excel. Wit the code below
I get 0612345678, but the value in Excel remains 612345678.

Regards,

Basta

"Sam Wilson" wrote:

activecell.numberformat = "00000-00000"

Sam

"Basta1980" wrote:

HI,

Code below works fine. Now I would like to make a small adjustment. The
activecell.value needs to be changed from 612345678 to 00612-345678 without
actually changing the format in the cell.

Dim MyData As DataObject
Set MyData = New DataObject
MyData.Clear
MyData.SetText "0" & ActiveCell.Offset(0, 0).Value
MyData.PutInClipboard

Thankx in advance.

Basta



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Numberformat

Hi Sam,

Thanx for helping. The actual numberformat is clear i.e. not the problem.
What I would like to do is just copy the value to clipboard in desired
numberformat without actually changing the value in Excel. Wit the code below
I get 0612345678, but the value in Excel remains 612345678.

Regards,

Basta

"Sam Wilson" wrote:

activecell.numberformat = "00000-00000"

Sam

"Basta1980" wrote:

HI,

Code below works fine. Now I would like to make a small adjustment. The
activecell.value needs to be changed from 612345678 to 00612-345678 without
actually changing the format in the cell.

Dim MyData As DataObject
Set MyData = New DataObject
MyData.Clear
MyData.SetText "0" & ActiveCell.Offset(0, 0).Value
MyData.PutInClipboard

Thankx in advance.

Basta

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Numberformat


Using Sam's suggestion, this is better

Dim MyData As DataObject

Set MyData = New DataObject
MyData.Clear
MyData.SetText = Format(ActiveCell.Value, "00000-000000")
MyData.PutInClipboard


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=149370

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Numberformat

Joel, Sam

Thanx for the input. Below suggestion works fine (just had to remove the =
because i got a variable error).

Thnx!!!

"joel" wrote:


Using Sam's suggestion, this is better

Dim MyData As DataObject

Set MyData = New DataObject
MyData.Clear
MyData.SetText = Format(ActiveCell.Value, "00000-000000")
MyData.PutInClipboard


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=149370

.

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
.numberformat Q Aaron Excel Worksheet Functions 4 December 18th 09 02:15 AM
NumberFormat danpt Excel Discussion (Misc queries) 3 May 20th 09 10:55 PM
NumberFormat RBeau Excel Programming 0 February 1st 08 11:42 PM
NumberFormat momak Excel Programming 1 July 20th 05 03:06 PM
VBA NumberFormat Digit Excel Programming 1 January 30th 05 02:30 PM


All times are GMT +1. The time now is 04:49 AM.

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

About Us

"It's about Microsoft Excel"