Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Below is a piece of my code:
If Cell.Offset(0, -1).Value < "Comment:" Then WSSD.Cells(rw, "A") = Cell.Offset(0, -1) WSSD.Cells(rw, "A").InsertIndent 3 rw = rw + 1 End If My problem is that I want WSSD.Cells(rw,"A") to have the same format as Cell.Offset(0,-1). However, I want to do this without copying and pasteing, selecting or activating. Is that possible? -- Thanks Shawn |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There are a lot of formatting options that you'd have to assign. Font size/font
name/italics, underlining, fill color, borders.... If you know exactly which of those you want to use, then you could just assign them in code: CellA.numberformat = cellb.numberformat cellA.font.name = cellb.font.name cellA.font.size = cellb.font.size ....and so forth Why not just cellb.copy cella.pastespecial paste:=xlpasteformats Shawn wrote: Below is a piece of my code: If Cell.Offset(0, -1).Value < "Comment:" Then WSSD.Cells(rw, "A") = Cell.Offset(0, -1) WSSD.Cells(rw, "A").InsertIndent 3 rw = rw + 1 End If My problem is that I want WSSD.Cells(rw,"A") to have the same format as Cell.Offset(0,-1). However, I want to do this without copying and pasteing, selecting or activating. Is that possible? -- Thanks Shawn -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 18 Jun 2007 18:37:01 -0700, Shawn
wrote: Below is a piece of my code: If Cell.Offset(0, -1).Value < "Comment:" Then WSSD.Cells(rw, "A") = Cell.Offset(0, -1) WSSD.Cells(rw, "A").InsertIndent 3 rw = rw + 1 End If My problem is that I want WSSD.Cells(rw,"A") to have the same format as Cell.Offset(0,-1). However, I want to do this without copying and pasteing, selecting or activating. Is that possible? If you don't want to copy/paste, and I'm not sure why you want to avoid that, you could do something like: with WSSD.Cells(rw,"A") .numberformat = cell.offset(0,-1) and so on for all of the other formatted parameters. It would seem simpler to do something like cell.offset(0,-1).copy wssd.cells(rw,"A").PasteSpecial Paste:=xlPasteFormats --ron |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 18 Jun 2007 22:08:29 -0400, Ron Rosenfeld
wrote: On Mon, 18 Jun 2007 18:37:01 -0700, Shawn wrote: Below is a piece of my code: If Cell.Offset(0, -1).Value < "Comment:" Then WSSD.Cells(rw, "A") = Cell.Offset(0, -1) WSSD.Cells(rw, "A").InsertIndent 3 rw = rw + 1 End If My problem is that I want WSSD.Cells(rw,"A") to have the same format as Cell.Offset(0,-1). However, I want to do this without copying and pasteing, selecting or activating. Is that possible? If you don't want to copy/paste, and I'm not sure why you want to avoid that, you could do something like: with WSSD.Cells(rw,"A") .numberformat = cell.offset(0,-1) and so on for all of the other formatted parameters. It would seem simpler to do something like cell.offset(0,-1).copy wssd.cells(rw,"A").PasteSpecial Paste:=xlPasteFormats --ron Ooops, that should have been: with WSSD.Cells(rw,"A") .numberformat = cell.offset(0,-1).numberformat and so on for all of the other formatted parameters. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Format Problem - Date Overrides Format | Excel Discussion (Misc queries) | |||
General Format to Custom format problem | Excel Discussion (Misc queries) | |||
Format problem | Excel Discussion (Misc queries) | |||
format problem | Excel Programming | |||
Format Problem | Excel Programming |