Gabriel Rotar
New Member
- Joined
- Mar 5, 2021
- Messages
- 7
- Office Version
- 2013
- Platform
- Windows
Hello,
I need generated a new macro from an existing one that is set to convert a certain cell into a desired date, but now I need to adapt the same code to update another cell to a special number format ex. "14.23"
Can somebody help me with the adjustments that I have to make on below code to be able to fill in the above values like?
There is that IsDate, CDate & DateValue to replace, but I need more deeper research then available time...
Thank you in advance!
Sub Bulk_Update_RequiredVersion()
Dim mbox As Variant
Dim num As Double
Dim folder_path As String
Dim wb As Workbook
Dim ws As Worksheet
Do
mbox = InputBox("Enter New Required Version", "Enter Number")
If StrPtr(mbox) = 0 Then Exit Sub
If IsDate(mbox) Then
txtRequire = CDate(mbox)
Else
MsgBox "The entered number is not valid"
End If
Loop Until IsDate(mbox)
num = DateValue(mbox)
folder_path = "D:\PLs"
my_files = Dir(folder_path & "\*.xlsx")
Do While my_files <> ""
Set wb = Workbooks.Open(folder_path & "\" & my_files)
Sheets("Product Line Information").Select
Cells.Find(What:="Required Version", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Cells.End(xlToRight).Select
ActiveCell = num
Range("A1").Select
Application.DisplayAlerts = False
ActiveWorkbook.RemovePersonalInformation = False
wb.Close True
my_files = Dir()
Loop
MsgBox ("All Files are Updated")
End Sub
I need generated a new macro from an existing one that is set to convert a certain cell into a desired date, but now I need to adapt the same code to update another cell to a special number format ex. "14.23"
Can somebody help me with the adjustments that I have to make on below code to be able to fill in the above values like?
There is that IsDate, CDate & DateValue to replace, but I need more deeper research then available time...
Thank you in advance!
Sub Bulk_Update_RequiredVersion()
Dim mbox As Variant
Dim num As Double
Dim folder_path As String
Dim wb As Workbook
Dim ws As Worksheet
Do
mbox = InputBox("Enter New Required Version", "Enter Number")
If StrPtr(mbox) = 0 Then Exit Sub
If IsDate(mbox) Then
txtRequire = CDate(mbox)
Else
MsgBox "The entered number is not valid"
End If
Loop Until IsDate(mbox)
num = DateValue(mbox)
folder_path = "D:\PLs"
my_files = Dir(folder_path & "\*.xlsx")
Do While my_files <> ""
Set wb = Workbooks.Open(folder_path & "\" & my_files)
Sheets("Product Line Information").Select
Cells.Find(What:="Required Version", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Cells.End(xlToRight).Select
ActiveCell = num
Range("A1").Select
Application.DisplayAlerts = False
ActiveWorkbook.RemovePersonalInformation = False
wb.Close True
my_files = Dir()
Loop
MsgBox ("All Files are Updated")
End Sub