Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Inserting "quotes" around characaters in a cell | Excel Discussion (Misc queries) | |||
how to copy contents of a cell and remove any quotes " " | Excel Discussion (Misc queries) | |||
inserting a conditional "go to" command on a excel "if" function | Excel Worksheet Functions | |||
Can I format a cell to include quotes " " | Excel Worksheet Functions |