Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Write to other sheets cells and include Cells.SpecialCells(xlCellTypeComments)

With this line of code working just fine, how do make it include cell comments when it writes to the other sheets.

Sheets(UCase(varCheck(n, m)) & shName).Cells(Rows.Count, 1) _
.End(xlUp)(2).Resize(2, 8) = .Cells(n + 1, 1).Resize(2, 8).Value


I guess there needs to be a reference to:

Cells.SpecialCells(xlCellTypeComments)

but I have not been able to blend it in.


Regular Range.Copy Destination works but writing to a range does not.

Thanks,

Howard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Write to other sheets cells and include Cells.SpecialCells(xlCellTypeComments)

Hi Howard,

Am Thu, 3 Dec 2015 17:45:02 -0800 (PST) schrieb L. Howard:

With this line of code working just fine, how do make it include cell comments when it writes to the other sheets.

Sheets(UCase(varCheck(n, m)) & shName).Cells(Rows.Count, 1) _
.End(xlUp)(2).Resize(2, 8) = .Cells(n + 1, 1).Resize(2, 8).Value


do you want to create comments or add text to existing comments in this
range? Are the comment cells in the same cell in source and target
sheet?


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Write to other sheets cells and include Cells.SpecialCells(xlCellTypeComments)


Sheets(UCase(varCheck(n, m)) & shName).Cells(Rows.Count, 1) _
.End(xlUp)(2).Resize(2, 8) = .Cells(n + 1, 1).Resize(2, 8).Value


do you want to create comments or add text to existing comments in this
range? Are the comment cells in the same cell in source and target
sheet?


Regards
Claus B.


Hi Claus,

The comments are on the source sheet and in the range that is to be written to the destination sheet.

The code as it is writes the cell values to the other sheet/s but does not bring the comments, if any, with the values.

The comments are notes about the values in the row. Don't want to do anything with the text in the comment. Just need the comment to be with the data after it is written to the other sheet/s.

Howard

Howard
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Write to other sheets cells and include Cells.SpecialCells(xlCellTypeComments)

Hi Howard,

Am Thu, 3 Dec 2015 23:13:51 -0800 (PST) schrieb L. Howard:

The comments are on the source sheet and in the range that is to be written to the destination sheet.

The code as it is writes the cell values to the other sheet/s but does not bring the comments, if any, with the values.

The comments are notes about the values in the row. Don't want to do anything with the text in the comment. Just need the comment to be with the data after it is written to the other sheet/s.


then it will be faster if you copy the range. Then the comments will go
to the target sheet and you don't have to loop through the specialcells.


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default Write to other sheets cells and include Cells.SpecialCells(xlCellTypeComments)



then it will be faster if you copy the range. Then the comments will go
to the target sheet and you don't have to loop through the specialcells.


Regards
Claus B.


Hi Claus,

Here is the whole code, it has a lot of work to do with about 800 +/- rows, written to as many as five sheets.

I believe we can live without the comments on the other sheets. One can refer back to the main sheet for the comment info.

Writing the comments over with the row data was going to be a suggestion, and not a current and present need.

So we can stay with the good fast working code as is.

Thanks.
Howard


Sub Copy_ALL_MASTER()
Dim LRow As Long, n As Long, m As Long
Dim varCheck As Variant

Const shName = "-Wellford Addresses"

With Sheets("Wellford Addresses-ALL, MASTER")

LRow = .Cells(Rows.Count, 1).End(xlUp).Row
varCheck = .Range("I2:M" & LRow)

For n = LBound(varCheck) To UBound(varCheck)

For m = LBound(varCheck, 2) To UBound(varCheck, 2)

If Len(varCheck(n, m)) 0 Then
If Sheets(UCase(varCheck(n, m)) & shName).Cells(2, 1) < "" Then

Sheets(UCase(varCheck(n, m)) & shName).Cells(Rows.Count, 1) _
.End(xlUp)(4).Resize(2, 8).Value = .Cells(n + 1, 1).Resize(2, 8).Value

Else
Sheets(UCase(varCheck(n, m)) & shName).Cells(Rows.Count, 1) _
.End(xlUp)(2).Resize(2, 8) = .Cells(n + 1, 1).Resize(2, 8).Value
End If

End If

Next m

Next n

End With

End Sub

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
Sum of a range of cells that include cells using LOOKUP klocascio Excel Worksheet Functions 3 November 3rd 09 05:45 PM
Use Selection.SpecialCells for cells with a particular value? h2fcell Excel Programming 6 September 28th 08 12:52 PM
The total of a couple cells and only include one of the cells if Jennifer Excel Discussion (Misc queries) 3 April 18th 07 07:43 AM
SpecialCells - no cells selected jims2994 Excel Programming 0 March 27th 07 11:53 PM
.Cells.SpecialCells(xlLastCell) Simon Shaw Excel Programming 8 May 5th 05 11:46 PM


All times are GMT +1. The time now is 05:54 PM.

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"