View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default post to different sheet

See changes below. I added code to use Sheet1 and Sheet2. Change Sheet
names as required. I added a WITH and the put periods in front of CELLS and
RANGE to reference the ite object in the WITH statement.

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
with sheets("Sheet1")
lastrow = .Cells(Rows.Count, "a").End(xlUp).Row
For Each c In .Range("b2:b" & lastrow)
c.Offset(, 5) = c & " [" & c.Offset(, 2) & "]"
Sheets("Sheet2").Range("A1") = c & " [" & c.Offset(, 2) & "]"
Next c
end With
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic

End Sub


"Darrell_Sarrasin via OfficeKB.com" wrote:

I have this coding


Private Sub CommandButton1_Click()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
For Each c In Range("b2:b" & lastrow)
c.Offset(, 5) = c & " [" & c.Offset(, 2) & "]"
Next c
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic

End Sub

It basically takes two cells and merges them together to make one. what I
want to do is take the post and merge the two cells together on a different
sheet.

Currently the line c.offset......... is what creates it but have been having
difficulties moving it to the otehr sheet.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200903/1