+ Reply to Thread
Results 1 to 5 of 5

Need VBA code copy a cell content to a particular cell

  1. #1
    Forum Contributor
    Join Date
    01-14-2004
    Location
    India
    MS-Off Ver
    365
    Posts
    264

    Need VBA code copy a cell content to a particular cell

    Hi
    I need a small VB Script.

    I have Sheets names "Store1", "Store2" & "Store3". Also I have another sheet called "DATA"
    I need to run a macro while I am in Any of the Store1, store2 or store 3.
    What I need is to copy the data of Colum-B of my active row and paste it in "DATA!B5" cell.

    Eg1: If I am in any of the cell in Row 11(eg.store1!K11) and when I run the macro, then it should copy Store!B11 data and paste it in "DATA!B5"
    Eg2: I am in Store2!S15. When I run the macro it should copy Store2!B15 and paste it in "DATA!B5"

    Hope it is clear
    Thanks a lot
    Tom
    Appreciate clicking the * Add Reputation button on your left side, if you want say thanks to me

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Need VBA code copy a cell content to a particular cell

    Hi, Tom,

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    01-14-2004
    Location
    India
    MS-Off Ver
    365
    Posts
    264

    Re: Need VBA code copy a cell content to a particular cell

    Hi
    Thanks but I would like to get the code without mentioning the active sheet name. I will have many sheets.
    Would appreciate a solution without mentioning the active sheet name but only to mention the destination sheet (DATA) .
    Thanks
    Tom

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Need VBA code copy a cell content to a particular cell

    Hi, Tom,

    sorry but I misread
    I need to run a macro while I am in Any of the Store1, store2 or store 3.
    If you want to run the macro on any sheet except data:
    Please Login or Register  to view this content.
    If you think it makes sense to be able to run the macro on every sheet just reduce the code to
    Please Login or Register  to view this content.
    but the last code would also run on Sheet Data in Row 5...

    Ciao,
    Holger

  5. #5
    Forum Contributor
    Join Date
    01-14-2004
    Location
    India
    MS-Off Ver
    365
    Posts
    264

    Re: Need VBA code copy a cell content to a particular cell

    Thank you Holger....

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1