Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default How to use two parameters in input of popup Variables - Gary's Student


HI All

Gary's Student kindly made some to code to allow input of variables via
popup :

Dim colstring As String
Dim findit As Double, replacewith As Double
colstring = Application.InputBox("Select Column ....", "Stage 1 of 3",
Type:=2)
findit = Application.InputBox("Column Selected : " & colstring & vbCr &
vbCr & "Select Value To Replace?", "Stage 2 of 3", Type:=1)
replacewith = Application.InputBox("Column Selected : " & colstring &
vbCr & vbCr & "Value Selected : " & findit & vbCr & vbCr &
"Replacement?", "Stage 3 of 3", Type:=1)
Columns(colstring).Select
Selection.Replace What:=findit, Replacement:=replacewith,
LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False


This allows selection of a column (colstring) , then a specific value
within in it (findit), and then replacement of that value with an input
(replacewith).


So , in the example of the code above , column A could be chosen where
cells value 6.50 are replaced with 8.50.

A
6.50
8.50


Could this be extended so that a second column is requested , and then
an additional value and only where a match is found would the
replacement be made?

For example

Column B could be chosen by popup , and a value say of Green. The column
A could be chosen with a value of 6.50. Those cells which match both
criteria in A are them replaced with 8.50

B
Green
A
6.50
8.50

Cells which have Green in column B which are at of 6.50 in column A are
replaced with 8.50 in Column A


can someone help with this?



Best Wishes

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
Gary's Student Part 3 or Anyone else ohnesorge Excel Discussion (Misc queries) 3 March 12th 09 05:04 PM
Map Network Drive FAO Gary's Student leerem Excel Discussion (Misc queries) 4 January 14th 09 03:53 PM
To Gary's Student Michael Fosmire [MSFT] Excel Discussion (Misc queries) 2 May 17th 07 02:09 PM
To: Gary's Student cell address reply ppbedz Excel Discussion (Misc queries) 5 April 17th 06 10:47 PM
Is Gary's Student here zmr325 Excel Discussion (Misc queries) 8 November 30th 05 01:17 PM


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

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"