Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Macro to insert formula iin column

HI,
I have the following set up
ColK ColL ColM Col S
Week 6 Week 7 Week 8 up to week 13 I'm summing all weeks

Every week, I'm inserting a Vlookup. Is there a way I can do this with a
macro?
Since i'm summing all weeks, I can't copy the vlookup to next column.
The vlookup will always be in Specific week column row2. I have to insert the
vlookup in a few sheets, so trying to see if there is a faster way than
doing
this manually.

Hope I'm making sense.
ANy help wold be really appreciated.
Thanks,
Juan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Macro to insert formula iin column

Hi Juan,

Could you post a copy of your vlookup formula for say week 7 and then again
for week 8. It will be easier to work out what needs to be done when can see
what changes are required.

To copy the formula to the post.
Select the cell with the formula.
Highlight the formula in the formula bar.
Ctrl/c to copy
Press Enter (ensure you do this Ctrl/c )
Paste the formula into the post.

Also what sheet name and range is the formula in for week 7 and then again
for week 8.

--
Regards,

OssieMac


"Juan" wrote:

HI,
I have the following set up
ColK ColL ColM Col S
Week 6 Week 7 Week 8 up to week 13 I'm summing all weeks

Every week, I'm inserting a Vlookup. Is there a way I can do this with a
macro?
Since i'm summing all weeks, I can't copy the vlookup to next column.
The vlookup will always be in Specific week column row2. I have to insert the
vlookup in a few sheets, so trying to see if there is a faster way than
doing
this manually.

Hope I'm making sense.
ANy help wold be really appreciated.
Thanks,
Juan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Macro to insert formula iin column

Hello Ossie,
thanks. here's the Vlookup and this will be in all weeks.
=VLOOKUP($C:$C,[StatServer.xls]Final!$A:$D,3,0)
When I'm done with that week, I just remove the Vlookup. So everyweek, I need
to reenter the VLOOKUP. Looking for a faster/easier way. I have a few sheets
that
I have to enter similar Vlookup.

Hope this makes sense.
appreciate any help you can provide
thanks,
Juan

"OssieMac" wrote:

Hi Juan,

Could you post a copy of your vlookup formula for say week 7 and then again
for week 8. It will be easier to work out what needs to be done when can see
what changes are required.

To copy the formula to the post.
Select the cell with the formula.
Highlight the formula in the formula bar.
Ctrl/c to copy
Press Enter (ensure you do this Ctrl/c )
Paste the formula into the post.

Also what sheet name and range is the formula in for week 7 and then again
for week 8.

--
Regards,

OssieMac


"Juan" wrote:

HI,
I have the following set up
ColK ColL ColM Col S
Week 6 Week 7 Week 8 up to week 13 I'm summing all weeks

Every week, I'm inserting a Vlookup. Is there a way I can do this with a
macro?
Since i'm summing all weeks, I can't copy the vlookup to next column.
The vlookup will always be in Specific week column row2. I have to insert the
vlookup in a few sheets, so trying to see if there is a faster way than
doing
this manually.

Hope I'm making sense.
ANy help wold be really appreciated.
Thanks,
Juan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Macro to insert formula iin column

Hello Ossie,
here's what i came up with:
Sub test()
Dim firstrow As Long
With ActiveSheet

firstrow = 2
Range(Application.InputBox("enter column") & firstrow).Select
Selection.Value = "=VLOOKUP($C:$C,[StatServer.xls]Final!$A:$D,3,0)"
End With
End Sub

This seems to be ok. I can run the macro every week and will put the formula
in the week I need. But appreciate if you have another idea. Is good to
always have more than one way of doing things.
Thanks,
Juan
"OssieMac" wrote:

Hi Juan,

Could you post a copy of your vlookup formula for say week 7 and then again
for week 8. It will be easier to work out what needs to be done when can see
what changes are required.

To copy the formula to the post.
Select the cell with the formula.
Highlight the formula in the formula bar.
Ctrl/c to copy
Press Enter (ensure you do this Ctrl/c )
Paste the formula into the post.

Also what sheet name and range is the formula in for week 7 and then again
for week 8.

--
Regards,

OssieMac


"Juan" wrote:

HI,
I have the following set up
ColK ColL ColM Col S
Week 6 Week 7 Week 8 up to week 13 I'm summing all weeks

Every week, I'm inserting a Vlookup. Is there a way I can do this with a
macro?
Since i'm summing all weeks, I can't copy the vlookup to next column.
The vlookup will always be in Specific week column row2. I have to insert the
vlookup in a few sheets, so trying to see if there is a faster way than
doing
this manually.

Hope I'm making sense.
ANy help wold be really appreciated.
Thanks,
Juan

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
Macro- Column Insert Toppers Excel Discussion (Misc queries) 1 August 17th 07 01:47 AM
Macro- Column Insert Toppers Excel Discussion (Misc queries) 0 August 17th 07 01:45 AM
Recorded single column insert in macro. Macro inserts two not one lostatlewisu Excel Programming 3 August 16th 07 01:26 AM
Macro - Insert&Label Column, if the labeled column doesn't exist Jeff[_43_] Excel Programming 1 December 15th 04 09:33 PM
Need Macro to Find Column Heading -- if none, then insert new column Jeff[_43_] Excel Programming 0 December 15th 04 07:08 AM


All times are GMT +1. The time now is 04:24 AM.

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"