Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a macro that changes values in wks2 in range b1:b100. Every time the
data changes I want to copy the values in wks1, always beginning on row 3 but the column number changes with a count. I can't figure out how to modify the following code: col=5 Worksheet("wks2").Range("b1:b100").Select Selection.Copy Sheets("wks1").Select ****on the next line I want to use "col"**** Range("D3").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
One way to do it: create a named range called Col and store the value
5 to it, then add this code to your routine Range("a3").Select 'use this instead of Range("D3").Select ActiveCell.Offset(0, Mid(Names("Col").Value, 2, Len(Names("Col").Value))).Select Names("Col").Value = Evaluate(Names("Col").Value) +1 This starts at A3, offsets by the value of Col, then augments Col by one for the next time it runs. The "ActiveCell.Offset" line contains the MID function to strip the = sign out of Names("Col").Value. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum or Count using set range | Excel Worksheet Functions | |||
How do I use the count if function for a range from 40-60 ? | Excel Worksheet Functions | |||
How to count dates within a certain range in a column with mutiple date range entries | Excel Worksheet Functions | |||
count no. of entries in range for a day | Excel Worksheet Functions | |||
Count cells in one range based on parameters in another range | Excel Worksheet Functions |