Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Macro inserting quotes "" in a cell

Does anyone know of a macro that will insert quotes around contents of a cell?

Thanks,
Kara Peterson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro inserting quotes "" in a cell

Hi Kara,

Try:
'=========
Public Sub AAA()
With ActiveCell
.Value = """" & .Value & """"
End With
End Sub

'<<=========

---
Regards,
Norman



"Kara" wrote in message
...
Does anyone know of a macro that will insert quotes around contents of a
cell?

Thanks,
Kara Peterson



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Macro inserting quotes "" in a cell

Another method

With ActiveCell
.Value = Chr$(34) & .Value & Chr$(34)
End With


--

http://www.vba.com.tw/plog/


"Norman Jones" wrote:

Hi Kara,

Try:
'=========
Public Sub AAA()
With ActiveCell
.Value = """" & .Value & """"
End With
End Sub

'<<=========

---
Regards,
Norman



"Kara" wrote in message
...
Does anyone know of a macro that will insert quotes around contents of a
cell?

Thanks,
Kara Peterson




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro inserting quotes "" in a cell


Hi Norman,
Why did you make this a "Public Sub AAA()"
rather than a "Sub AAA()" ?
Dave
Norman Jones Wrote:
Hi Kara,

Try:
'=========
Public Sub AAA()
With ActiveCell
.Value = """" & .Value & """"
End With
End Sub

'<<=========

---
Regards,
Norman



"Kara" wrote in message
...
Does anyone know of a macro that will insert quotes around contents

of a
cell?

Thanks,
Kara Peterson



--
Piranha
------------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=484446

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro inserting quotes "" in a cell

Hi Dave,

Why did you make this a "Public Sub AAA()"
rather than a "Sub AAA()" ?


Primarily because of a penchant for explicitness. If the scope of a sub is
not explicitly specified (as in your second example) it is Public by
default.

A public sub procedure is accessible to procedures in other modules;
conversely, when declared as Private, a sub is accessible only to procedures
in the same module

For more information, look at the Public, Private and Sub statements in VBA
help.


---
Regards,
Norman




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro inserting quotes "" in a cell


Hi Norman,
Thx for this enlightenment. I knew about the Private Sub, But i though
the Public
was _only_ for when you want a sub that's in the WorkSheet or WorkBoo
module
to be global in the WorkBook. But a Sub in a General Module is Globa
in the Workbook.

Thx Much
Dave

Norman Jones Wrote:
Hi Dave,

Why did you make this a "Public Sub AAA()"
rather than a "Sub AAA()" ?


Primarily because of a penchant for explicitness. If the scope of a su
is
not explicitly specified (as in your second example) it is Public by
default.

A public sub procedure is accessible to procedures in other modules;
conversely, when declared as Private, a sub is accessible only t
procedures
in the same module

For more information, look at the Public, Private and Sub statements i
VBA
help.


---
Regards,
Norma


--
Piranh
-----------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2043
View this thread: http://www.excelforum.com/showthread.php?threadid=48444

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Inserting "quotes" around characaters in a cell Lolo79 Excel Discussion (Misc queries) 2 November 1st 07 11:52 PM
how to copy contents of a cell and remove any quotes " " jonny Excel Discussion (Misc queries) 2 January 28th 07 06:48 PM
inserting a conditional "go to" command on a excel "if" function velasques Excel Worksheet Functions 5 March 10th 06 08:16 PM
Can I format a cell to include quotes " " Speed2772 Excel Worksheet Functions 2 December 13th 05 08:11 PM


All times are GMT +1. The time now is 01:19 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"