Transfer of data to other sheet

Closed
musharafpk Posts 4 Registration date Sunday November 8, 2015 Status Member Last seen January 14, 2016 - Nov 8, 2015 at 08:00 AM
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 - Nov 11, 2015 at 07:18 PM
If I put a name in cell AC4 then I want to transfer value of cell A4 & Y4 to other sheet. Can some some help me in this matter.

Thanks

Musharaf

3 responses

vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 259
Nov 9, 2015 at 04:28 AM
Hello Musharafpk,

I assume that you only want the values of the two individual cells A4 and Y4 transferred to sheet2, not the whole row from A4 to Y4. If so, then the following code may help:-

Sub CopyIt()

Application.ScreenUpdating = False

If Range("AC4").Value <> "" Then
      Range("A4,Y4").Copy
      Sheet2.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
End If

Application.ScreenUpdating = True
Application.CutCopyMode = False
Sheet2.Select

End Sub


You can have a look at my test work book here:-

https://www.dropbox.com/s/459ovszsj464cs2/Musharafpk.xlsm?dl=0

to see if it is what you would like. Click on the "Copy" button to see it work.

I hope that this helps.

Cheerio,
vcoolio.
0
musharafpk Posts 4 Registration date Sunday November 8, 2015 Status Member Last seen January 14, 2016
Nov 9, 2015 at 07:01 AM
Dear Vcoolio thanks for your attention and help if you like then can i send you my working sheets for complete help and solution.

Waiting for your kind reply
0
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 259
Nov 10, 2015 at 01:37 AM
Hello Musharafpk,

You can upload a sample of your work book by using a free file sharing site such as DropBox, ge.tt or Speedyshare and then advise us of the link to your file ( much like the link to my test file above).

Be careful with any sensitive data.

Cheerio,
vcoolio.
0
musharafpk Posts 4 Registration date Sunday November 8, 2015 Status Member Last seen January 14, 2016
Nov 11, 2015 at 07:26 AM
Dear Vcoolio

https://www.dropbox.com/s/wzhc20elke22bzz/Main%20sheet%20working.xlsx?dl=0 please see this link for my help.

Thanks
0
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 259
Nov 11, 2015 at 07:18 PM
Hello Musharafpk,

Based solely on your comments in AA4, the following code should work for you:-

Sub CopyData()

Application.ScreenUpdating = False

If Range("AA4") <> "" Then
      Range("A4").Copy
      Sheets("Tariq").Range("B" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
      Range("AA4").Copy
      Sheets("Tariq").Range("E" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues
End If

Sheets("Tariq").Select
Application.ScreenUpdating = True
Application.CutCopyMode = False

End Sub



Here is a link to your work book updated with the code:-

https://www.dropbox.com/s/34trvgenubslicx/Musharafpk%282%29.xlsm?dl=0

You will note that in the sheet "Tariq", I have removed the formulas from Column E as you do not have them in rows 4 - 9 and they were also hindering the correct pasting process on execution of the code.

I hope that this helps.

Cheerio,
vcoolio.
0