Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have 3 columns in sheet totals, Date, ID & Status
and 3 cells in sheet Aug B1, B2 & B3 where we can enter Date, ID & Status and when clicked on submit button, I need a macro to match date and ID from sheet totals and replace Status again in sheet totals. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 25 Aug, 07:54, Kash wrote:
I have 3 columns in sheet totals, Date, ID & Status and 3 cells in sheet Aug B1, B2 & B3 where we can enter Date, ID & Status and when clicked on submit button, I need a macro to match date and ID from sheet totals and replace Status again in sheet totals. Can you add a calculated column that contains the CONCATENATE of the Date and ID (with a separator), e.g. =CONCATENATE(A1,"|",B1)? Then when you do a Find(), you need to use the Value2 of the date cell in order to get it in the same format as the cell formula: Dim Cell As Range Set Cell = Sheets("totals").Cells.Find(Cells(1,1).Value2 & "|" & Cells (1,2)) Sheets("totals").Cells(Cell.Row,Cell.Column+1) = Cells(1,3) Code is untested. Phil Hibbs. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
assumes D,E and F are Date,ID and Status on totals sheet. change accordingly
Option Explicit Sub UpdateTable() Dim aDate As Date Dim aID As String Dim aStatus As String Dim bFound As Boolean With Worksheets("aug") aDate = .Range("B1") aID = .Range("B2") aStatus = .Range("B3") End With With Worksheets("totals") Dim index As Long index = 1 Do Until IsEmpty(.Cells(index, "D")) If .Cells(index, "D") = aDate Then If .Cells(index, "E") = aID Then .Cells(index, "F") = aStatus bFound = True Exit Do End If End If index = index + 1 Loop If bFound Then MsgBox aID & " for " & aDate & " changed to " & aStatus Else MsgBox aID & " for " & aDate & " was not found" End If End With End Sub "Phil Hibbs" wrote: On 25 Aug, 07:54, Kash wrote: I have 3 columns in sheet totals, Date, ID & Status and 3 cells in sheet Aug B1, B2 & B3 where we can enter Date, ID & Status and when clicked on submit button, I need a macro to match date and ID from sheet totals and replace Status again in sheet totals. Can you add a calculated column that contains the CONCATENATE of the Date and ID (with a separator), e.g. =CONCATENATE(A1,"|",B1)? Then when you do a Find(), you need to use the Value2 of the date cell in order to get it in the same format as the cell formula: Dim Cell As Range Set Cell = Sheets("totals").Cells.Find(Cells(1,1).Value2 & "|" & Cells (1,2)) Sheets("totals").Cells(Cell.Row,Cell.Column+1) = Cells(1,3) Code is untested. Phil Hibbs. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How to select corresponding row without entering any value?
|
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
??
-- Don Guillett Microsoft MVP Excel SalesAid Software "Kash" wrote in message ... How to select corresponding row without entering any value? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find and Replace - Replace with Blank Space | Excel Discussion (Misc queries) | |||
Find/Replace Event or Find/Replace for Protected Sheet ... | Excel Programming | |||
find and replace - replace data in rows to separated by commas | Excel Worksheet Functions | |||
Using Find and Replace to replace " in a macro | Excel Programming | |||
Replace method - cannot find any data to replace | Excel Programming |