ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to insert formula iin column (https://www.excelbanter.com/excel-programming/424013-macro-insert-formula-iin-column.html)

Juan

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

OssieMac

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


Juan

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


Juan

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



All times are GMT +1. The time now is 11:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com