Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default post to different sheet

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default post to different sheet

Thank you for the information but it is not working. the one before takes
two different cells and combines them together to make 1 someone else on the
same sheet. What you have sent me will post to another sheet but it is only
posting the brackets not the information


joel wrote:
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

I have this coding

[quoted text clipped - 17 lines]
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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default post to different sheet

The value of "C" is nothing just leaving blanks. Try replace "C" with
"C.VALUE". I'm not sure what your code looks like, but you may have a
problem with the way you are setting the value of "C". Look where I place
the period in front of RANGE and CELLS so it refers to your old worksheet. I
suspect that "C" is referencing the wrong worksheet.

"Darrell_Sarrasin via OfficeKB.com" wrote:

Thank you for the information but it is not working. the one before takes
two different cells and combines them together to make 1 someone else on the
same sheet. What you have sent me will post to another sheet but it is only
posting the brackets not the information


joel wrote:
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

I have this coding

[quoted text clipped - 17 lines]
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


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
Re-post: Code to make sheet very hidden based on date wx4usa Excel Discussion (Misc queries) 1 December 30th 08 06:19 AM
Post to a Sheet Depending on a Value within a Cell Q Sean Excel Programming 5 April 17th 07 12:35 PM
Does anyone know how I can seperate a post code in my data sheet? gsmcellular Excel Discussion (Misc queries) 3 July 8th 06 01:32 PM
Opening Recovered Sheet - 3rd Post Terri[_5_] Excel Programming 2 August 18th 04 05:17 PM
Opening Recovered Sheet - 2nd Post Terri[_5_] Excel Programming 0 August 13th 04 07:45 PM


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