![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Location: Aberdeen, Scotland, UK
Posts: 35
|
I have the following macro that goes to the bottom of a range of data, copies the last line of formula's, pastes them into the line below. (this then updates charts using dynamic ranges)
The macro also finds all references to "feb" and replaces with "mar" to update the formulas to read the next months data. However, I want the Macro to use the value in a certain cell (the last populated cell in column A) as the "find" variable, and then ask the user for the "replace" value. Anyone know how to do this? Macro as is: Range("a1").Select Selection.End(xlDown).Select Range(Selection, Selection.End(xlToRight)).Select Selection.Copy Range("a1").Select Selection.End(xlDown).Offset(1, 0).Select Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=False Application.CutCopyMode = False Selection.replace What:="feb", Replacement:="mar", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Use
What:=Range("A65536").End(xlUp) |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|