PC Review


Reply
Thread Tools Rate Thread

Copy cell of one sheet to another sheet

 
 
Bobbo
Guest
Posts: n/a
 
      22nd Dec 2009
I need a macro that will copy Cell C3 from one sheet and add it to another
sheet starting at A5. If A5 already has something in it then use A6

Thx
Bob
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      22nd Dec 2009
Sub dk()
Dim lr As Long, sh As Worksheet, sh2 As Worksheet
Set sh = Sheets("Sheet1")
Set sh2 = Sheets("Sheet2")
lr = sh2.Cells(Rows.Count, 1).End(xlUp).Row
sh.Range("C3").Copy sh2.Range("A" & lr+1)
End Sub

Change the sheet names to suit.





"Bobbo" <(E-Mail Removed)> wrote in message
news:8C59F170-A8C0-47F1-A9E2-(E-Mail Removed)...
>I need a macro that will copy Cell C3 from one sheet and add it to another
> sheet starting at A5. If A5 already has something in it then use A6
>
> Thx
> Bob



 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      22nd Dec 2009
Try this. Modify sheet name to suit

Sub copyc3toothersheet()
With Sheets("sheet14")
If Len(Application.Trim(.Range("a5"))) < 1 Then
lr = 5
Else
lr = .Cells(4, "a").End(xlDown).Row + 1
End If
'MsgBox lr
Range("c3").Copy .Cells(lr, "a")
End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Bobbo" <(E-Mail Removed)> wrote in message
news:8C59F170-A8C0-47F1-A9E2-(E-Mail Removed)...
>I need a macro that will copy Cell C3 from one sheet and add it to another
> sheet starting at A5. If A5 already has something in it then use A6
>
> Thx
> Bob


 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      22nd Dec 2009
What if there is something in cell a12

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"JLGWhiz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sub dk()
> Dim lr As Long, sh As Worksheet, sh2 As Worksheet
> Set sh = Sheets("Sheet1")
> Set sh2 = Sheets("Sheet2")
> lr = sh2.Cells(Rows.Count, 1).End(xlUp).Row
> sh.Range("C3").Copy sh2.Range("A" & lr+1)
> End Sub
>
> Change the sheet names to suit.
>
>
>
>
>
> "Bobbo" <(E-Mail Removed)> wrote in message
> news:8C59F170-A8C0-47F1-A9E2-(E-Mail Removed)...
>>I need a macro that will copy Cell C3 from one sheet and add it to another
>> sheet starting at A5. If A5 already has something in it then use A6
>>
>> Thx
>> Bob

>
>


 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      22nd Dec 2009
Forgot starting in A5

Sub dk()
Dim lr As Long, sh As Worksheet, sh2 As Worksheet
Set sh = Sheets("Sheet1")
Set sh2 = Sheets("Sheet2")
lr = sh2.Cells(Rows.Count, 1).End(xlUp).Row
If shw.Range("A5") = "" Then
sh.Range("C3").Copy sh2.Range("A5")
Else
sh.Range("C3").Copy sh2.Range("A" & lr+1)
End If
End Sub

Change the sheet names to suit.

"JLGWhiz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sub dk()
> Dim lr As Long, sh As Worksheet, sh2 As Worksheet
> Set sh = Sheets("Sheet1")
> Set sh2 = Sheets("Sheet2")
> lr = sh2.Cells(Rows.Count, 1).End(xlUp).Row
> sh.Range("C3").Copy sh2.Range("A" & lr+1)
> End Sub
>
> Change the sheet names to suit.
>
>
>
>
>
> "Bobbo" <(E-Mail Removed)> wrote in message
> news:8C59F170-A8C0-47F1-A9E2-(E-Mail Removed)...
>>I need a macro that will copy Cell C3 from one sheet and add it to another
>> sheet starting at A5. If A5 already has something in it then use A6
>>
>> Thx
>> Bob

>
>



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      23rd Dec 2009
Had a typo:

Sub dk()
Dim lr As Long, sh As Worksheet, sh2 As Worksheet
Set sh = Sheets("Sheet1")
Set sh2 = Sheets("Sheet2")
lr = sh2.Cells(Rows.Count, 1).End(xlUp).Row
If sh2.Range("A5") = "" Then
sh.Range("C3").Copy sh2.Range("A5")
Else
sh.Range("C3").Copy sh2.Range("A" & lr+1)
End If
End Sub





"JLGWhiz" <(E-Mail Removed)> wrote in message
news:ujf%(E-Mail Removed)...
> Forgot starting in A5
>
> Sub dk()
> Dim lr As Long, sh As Worksheet, sh2 As Worksheet
> Set sh = Sheets("Sheet1")
> Set sh2 = Sheets("Sheet2")
> lr = sh2.Cells(Rows.Count, 1).End(xlUp).Row
> If shw.Range("A5") = "" Then
> sh.Range("C3").Copy sh2.Range("A5")
> Else
> sh.Range("C3").Copy sh2.Range("A" & lr+1)
> End If
> End Sub
>
> Change the sheet names to suit.
>
> "JLGWhiz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Sub dk()
>> Dim lr As Long, sh As Worksheet, sh2 As Worksheet
>> Set sh = Sheets("Sheet1")
>> Set sh2 = Sheets("Sheet2")
>> lr = sh2.Cells(Rows.Count, 1).End(xlUp).Row
>> sh.Range("C3").Copy sh2.Range("A" & lr+1)
>> End Sub
>>
>> Change the sheet names to suit.
>>
>>
>>
>>
>>
>> "Bobbo" <(E-Mail Removed)> wrote in message
>> news:8C59F170-A8C0-47F1-A9E2-(E-Mail Removed)...
>>>I need a macro that will copy Cell C3 from one sheet and add it to
>>>another
>>> sheet starting at A5. If A5 already has something in it then use A6
>>>
>>> Thx
>>> Bob

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy rows from one Data sheet to another sheet based on cell conte John McKeon Microsoft Excel Misc 2 15th May 2010 06:49 AM
Copy Data from Sheet 1 to Empty Cell in Sheet 2 dtoland Microsoft Excel Programming 2 4th Nov 2009 06:48 PM
Auto copy cell data from source sheet to another wrkbook sheet IVLUTA Microsoft Excel Programming 2 2nd Jun 2009 05:07 PM
Help: auto-copy entire rows from 1 sheet (based on cell criteria) to another sheet. bertbarndoor Microsoft Excel Programming 4 5th Oct 2007 04:00 PM
how to copy a cell with formula from sheet 1 (data is all vertical) into sheet 2 parag Microsoft Excel Worksheet Functions 3 15th Jun 2006 10:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:17 AM.