PC Review


Reply
Thread Tools Rate Thread

Creating a macro to paste in a specific cell

 
 
Carlos
Guest
Posts: n/a
 
      5th Feb 2008
Hi,

I'm trying to work out if it's possible to create a macro that will find a
cell from one workbook and identify that as the "range" cell so it can paste
information into relative cells.

For example. I have this information being updated daily.

A1 B1 C1 etc
15/01/2008 data 1 Data 2 etc

And I want the a macro that will search another workbook to find the Date
15/01/2008 and make this the range cell so that I can copy and paste B1, C1
etc into the next cells.?

Can this be done?

Thanks
Carl
 
Reply With Quote
 
 
 
 
Dude Ranch
Guest
Posts: n/a
 
      5th Feb 2008
Hey Carlos
This sould pretty stright forward and a good one to learn on.
And as always with Excel there is many ways to skin the cat.

Your Macro need merely hold the value to look up 15/01/2008 in yr eg.
Then activate the other workbook, systematically search an area for your
lookup value.
You will now have a location to copy to it is a simple step to code the
copy.

Have fun

Aloha
Jeff


"Carlos" <(E-Mail Removed)> wrote in message
news:2D456724-8FEF-4887-9A18-(E-Mail Removed)...
> Hi,
>
> I'm trying to work out if it's possible to create a macro that will find a
> cell from one workbook and identify that as the "range" cell so it can
> paste
> information into relative cells.
>
> For example. I have this information being updated daily.
>
> A1 B1 C1 etc
> 15/01/2008 data 1 Data 2 etc
>
> And I want the a macro that will search another workbook to find the Date
> 15/01/2008 and make this the range cell so that I can copy and paste B1,
> C1
> etc into the next cells.?
>
> Can this be done?
>
> Thanks
> Carl



 
Reply With Quote
 
Carlos
Guest
Posts: n/a
 
      5th Feb 2008
Hi Jeff,

Thanks for the quick reply, What I should have said was that Cell A1 (the
date) is a variable. So next day it will have the following day's date, which
it needs to search for and make the range cell.

So in the programming it's got when it's a constant is

Cells.Find(What:="Carl", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

(I've changed find with my name for ease) But what I would like it to do is
search for the text that would be in cell A1 rather then a constant text?

Is this possible?

Thanks again
Carl


"Dude Ranch" wrote:

> Hey Carlos
> This sould pretty stright forward and a good one to learn on.
> And as always with Excel there is many ways to skin the cat.
>
> Your Macro need merely hold the value to look up 15/01/2008 in yr eg.
> Then activate the other workbook, systematically search an area for your
> lookup value.
> You will now have a location to copy to it is a simple step to code the
> copy.
>
> Have fun
>
> Aloha
> Jeff
>
>
> "Carlos" <(E-Mail Removed)> wrote in message
> news:2D456724-8FEF-4887-9A18-(E-Mail Removed)...
> > Hi,
> >
> > I'm trying to work out if it's possible to create a macro that will find a
> > cell from one workbook and identify that as the "range" cell so it can
> > paste
> > information into relative cells.
> >
> > For example. I have this information being updated daily.
> >
> > A1 B1 C1 etc
> > 15/01/2008 data 1 Data 2 etc
> >
> > And I want the a macro that will search another workbook to find the Date
> > 15/01/2008 and make this the range cell so that I can copy and paste B1,
> > C1
> > etc into the next cells.?
> >
> > Can this be done?
> >
> > Thanks
> > Carl

>
>
>

 
Reply With Quote
 
Dude Ranch
Guest
Posts: n/a
 
      5th Feb 2008
Carl (os)
My friend you have DONE all the hard work.

merely replace the "Carl" in your code with a variable say find_me

then before this line executes add
Find_me=range("A1").value

or code that effect (make sure you are in the workbook first though)

You sound close keep going.

Aloha
Jeff


"Carlos" <(E-Mail Removed)> wrote in message
news:7BE5ECDD-E218-4041-98E2-(E-Mail Removed)...
> Hi Jeff,
>
> Thanks for the quick reply, What I should have said was that Cell A1 (the
> date) is a variable. So next day it will have the following day's date,
> which
> it needs to search for and make the range cell.
>
> So in the programming it's got when it's a constant is
>
> Cells.Find(What:="Carl", After:=ActiveCell, LookIn:=xlFormulas, LookAt
> _
> :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
> MatchCase:= _
> False, SearchFormat:=False).Activate
>
> (I've changed find with my name for ease) But what I would like it to do
> is
> search for the text that would be in cell A1 rather then a constant text?
>
> Is this possible?
>
> Thanks again
> Carl
>
>
> "Dude Ranch" wrote:
>
>> Hey Carlos
>> This sould pretty stright forward and a good one to learn on.
>> And as always with Excel there is many ways to skin the cat.
>>
>> Your Macro need merely hold the value to look up 15/01/2008 in yr eg.
>> Then activate the other workbook, systematically search an area for your
>> lookup value.
>> You will now have a location to copy to it is a simple step to code the
>> copy.
>>
>> Have fun
>>
>> Aloha
>> Jeff
>>
>>
>> "Carlos" <(E-Mail Removed)> wrote in message
>> news:2D456724-8FEF-4887-9A18-(E-Mail Removed)...
>> > Hi,
>> >
>> > I'm trying to work out if it's possible to create a macro that will
>> > find a
>> > cell from one workbook and identify that as the "range" cell so it can
>> > paste
>> > information into relative cells.
>> >
>> > For example. I have this information being updated daily.
>> >
>> > A1 B1 C1 etc
>> > 15/01/2008 data 1 Data 2 etc
>> >
>> > And I want the a macro that will search another workbook to find the
>> > Date
>> > 15/01/2008 and make this the range cell so that I can copy and paste
>> > B1,
>> > C1
>> > etc into the next cells.?
>> >
>> > Can this be done?
>> >
>> > Thanks
>> > Carl

>>
>>
>>



 
Reply With Quote
 
Carlos
Guest
Posts: n/a
 
      5th Feb 2008
Jeff,

Thank you very much.. It's been bugging me all morning.. But works a treat
now..

I've only really started working with excel and macros the last few days to
create something for work, But it's so facinating.. And the things I've
learnt to do allready is brilliant!!

Thanks again for your help
Carl

"Dude Ranch" wrote:

> Carl (os)
> My friend you have DONE all the hard work.
>
> merely replace the "Carl" in your code with a variable say find_me
>
> then before this line executes add
> Find_me=range("A1").value
>
> or code that effect (make sure you are in the workbook first though)
>
> You sound close keep going.
>
> Aloha
> Jeff
>
>
> "Carlos" <(E-Mail Removed)> wrote in message
> news:7BE5ECDD-E218-4041-98E2-(E-Mail Removed)...
> > Hi Jeff,
> >
> > Thanks for the quick reply, What I should have said was that Cell A1 (the
> > date) is a variable. So next day it will have the following day's date,
> > which
> > it needs to search for and make the range cell.
> >
> > So in the programming it's got when it's a constant is
> >
> > Cells.Find(What:="Carl", After:=ActiveCell, LookIn:=xlFormulas, LookAt
> > _
> > :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
> > MatchCase:= _
> > False, SearchFormat:=False).Activate
> >
> > (I've changed find with my name for ease) But what I would like it to do
> > is
> > search for the text that would be in cell A1 rather then a constant text?
> >
> > Is this possible?
> >
> > Thanks again
> > Carl
> >
> >
> > "Dude Ranch" wrote:
> >
> >> Hey Carlos
> >> This sould pretty stright forward and a good one to learn on.
> >> And as always with Excel there is many ways to skin the cat.
> >>
> >> Your Macro need merely hold the value to look up 15/01/2008 in yr eg.
> >> Then activate the other workbook, systematically search an area for your
> >> lookup value.
> >> You will now have a location to copy to it is a simple step to code the
> >> copy.
> >>
> >> Have fun
> >>
> >> Aloha
> >> Jeff
> >>
> >>
> >> "Carlos" <(E-Mail Removed)> wrote in message
> >> news:2D456724-8FEF-4887-9A18-(E-Mail Removed)...
> >> > Hi,
> >> >
> >> > I'm trying to work out if it's possible to create a macro that will
> >> > find a
> >> > cell from one workbook and identify that as the "range" cell so it can
> >> > paste
> >> > information into relative cells.
> >> >
> >> > For example. I have this information being updated daily.
> >> >
> >> > A1 B1 C1 etc
> >> > 15/01/2008 data 1 Data 2 etc
> >> >
> >> > And I want the a macro that will search another workbook to find the
> >> > Date
> >> > 15/01/2008 and make this the range cell so that I can copy and paste
> >> > B1,
> >> > C1
> >> > etc into the next cells.?
> >> >
> >> > Can this be done?
> >> >
> >> > Thanks
> >> > Carl
> >>
> >>
> >>

>
>
>

 
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
RE: Paste Specific Cell to Selected Cell =?Utf-8?B?Q0xS?= Microsoft Excel Worksheet Functions 0 12th Jan 2007 08:02 PM
A Macro that will cut and paste to specific cell =?Utf-8?B?VkJBMTJ0aFJvdW5kRHJhZnRQaWNr?= Microsoft Excel Misc 1 31st Mar 2005 06:11 AM
Copy and Paste macro needs to paste to a changing cell reference =?Utf-8?B?bG91bG91?= Microsoft Excel Programming 0 24th Feb 2005 10:29 AM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski Microsoft Excel Programming 1 28th May 2004 06:50 PM
Using a macro to paste a row that contains a specific value HoundofCullin Microsoft Excel Misc 7 24th Dec 2003 01:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:00 PM.