Posts by pragov

    Hi All,


    I have a report which contains a service type field, which is column D, with values such as


    SERVICE Type


    GUIDE
    CONNECT
    FOLLOW


    I have a program with a hyperlink


    Code
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="http://test.values.com?tool=Hlink&sc=testing\/primary&ph=" & Range("K" & rw).Value _
    & "&stme=" & Range("B" & rw).Value & "&etme=" & Range("C" & rw).Value, TextToDisplay:="HLINK"


    The table, HlinkValue contains values such as


    SERVICE Type FOLDER
    GUIDE primary
    CONNECT bin
    FOLLOW secondary


    What I need help is for my code to identify is, if I am on row 1 and the value of service type is GUIDE, then the value of sc should be testing\/prime or if it is CONNECT, the value should be testing\/bin.



    Thanks,


    Pragov

    I was able to resolve my issue of inserting a column after a report was created as well as including a hyperlink.


    Now, how do I do this


    For i to LastRow
    Str = “http://" & range(“URLAddress”).value &"sc=" testing & "ph=" & cell_that_contains_phoneNo & "st=" & cell_that_contains_starttimevalue & "et=" & cell_that_contains_endtimevalue


    Range("A” & i").Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address=Str, TextToDisplay:="CONNECT"
    Next i


    How do I read the sc, ph, st and et values?
    sc: cell that contains service type (if the value is GUIDE, then sc = testing)
    ph :cell_that_contains_phoneNo - 6th field
    st:cell_that_contains_starttimevalue - 2nd field
    et:cell_that_contains_endtimevalue - 3rd field.


    How would I refer to the cells 2nd, 3rd and 6th in my Address?

    I modified my code as


    'Hlink Code


    Columns("A:A").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("A1").Value = "Hlink"


    With ActiveSheet
    col = FindCol("Hlink", 1, .Name)
    LastRow = .Range("A1").CurrentRegion.Rows.Count
    If col > 0 Then
    X = .Range(.Cells(1, col), .Cells(LastRow, col))
    For rw = 2 To LastRow


    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
    "http://testing.com?tool=HLINK" _
    , TextToDisplay:="CONNECT"


    Next rw
    .Range(.Cells(1, col), .Cells(LastRow, col)) = X
    End If


    End With



    I am getting [FONT="Calibri"]an “invalid call or procedure” error for the Hyperlink[/FONT]

    Hi All,


    This is a two part question.


    I have an existing report to which I need to insert an hyperlinked field at "A1" called Hlink.


    I need to insert a column in before col B and name it "Hlink". Also, I need to have this column as hyperlinked and the text called "CONNECT"
    I am not sure of how to use the OFFSET effectively.


    The second part is:


    for the address, I need to read values from the content of other fields in the report as in



    This is part of the hyperlink code, I am trying to use


    For i to LastRow
    Str = “http://" & range(“URLAddress”).value &"sc=" testing & "ph=" & cell_that_contains_phoneNo & "st=" & cell_that_contains_starttimevalue & "et=" & cell_that_contains_endtimevalue


    Range("A” & i").Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address=Str, TextToDisplay:="CONNECT"
    Next i


    How do I read the sc, ph, st and et values?
    sc: cell that contains service type (if the value is GUIDE, then sc = testing)
    ph :cell_that_contains_phoneNo - 6th field
    st:cell_that_contains_starttimevalue - 2nd field
    et:cell_that_contains_endtimevalue - 3rd field.


    I am attaching a sample report with bare minimum code.


    Thanks,


    Pragov

    Re: Formatting dates


    I was able to solve it

    Code
    Date=     Format(Mid(A1, 1, 19), "yymmdd")
       Hour=     Format(Mid(A1, 1, 19), "Hh")
       Minute=     Format(Mid(A1, 1, 19), "Nn")


    pragov

    Hi All,


    I have a value of the field, ProcessDate as 2016-05-18 19:27:40


    I need to format 2016-05-18 as 1160518 - Pdate and 19:27 to 19 - PHour and 27 - Pmin


    How do I do this in one single function or in three steps using VBA?


    [TABLE="width: 547"]

    [tr]



    [/tr]


    [/TABLE]
    [TABLE="width: 124"]

    [tr]


    [TD="class: xl82, width: 124"]Thanks,
    pragov
    [/TD]

    [/tr]


    [/TABLE]

    Re: Clickable link on cells


    The field will contain code, which allows users to bring up data related to this field, when they click on it.
    This is an existing field, which was not used in this manner. It is being explored as field that can be viable.


    Can you let me know how to implement?

    Hi All,


    Is it possible to create click able cells, similar to hyperlinks using excel vba?
    The issue is my field doesn’t have a “:” or “@” that can be formatted as a hyperlink.


    How to reproduce a functionality similar to hyperlink, with the blue underline?
    Or any alternative?


    Thanks,
    pragov

    Re: shift columns


    Hi,
    I get an error on line
    ActiveSheet.Columns("H").Delete


    It says that excel resources cannot perform this action.
    The first two lines were done.


    Thanks,
    pragov

    Hi All,


    I have a report with columns AA to AZ.


    After I run the query and during formatting the report, I need to shift Col G to col A first and then col F to col B.


    How would I use the Insert Col before A, Select Col G, do the shift left? Then again do a insert column after A and select col F and shift to left to col B.


    so Now col G becomes col A, col F becomes col B and col A becomes col C.


    I am aware of this but run into errors.


    Thanks,


    pragov

    Hi All,


    I am using two listboxes to select items to be displayed on a report. I bring the form containing the two listboxes from the parent form's "Prudt" command button.
    I use CR.Show and the list box form appears.


    The navigation buttons such as add, remove etc work well initially. But after a while the Add and Rem events are not possible.It seems as if the listboxes need to be refreshed.But the AddAll and RemAll work well.
    This does not happen when the form("Prudt") is initially opened.


    ..



    Is it a refresh issue or anything else? What's confusing is,the first time when the forms are open,all these navigations work.


    Thanks


    pragov

    Hi All,


    I am using this code, to populate a range used as a rowsource for listbox.


    But it skips the first field and populates other fields starting from the second one.
    Not sure why?


    Secondly, If I need to restrict the entries in my ListBox to Unique values, how would I do that?


    Thanks,


    Pragov

    Re: Transfer from ListBox to TextBox


    When I do the above way,


    I am getting the result in the textbox as
    ,CREATION TS,Global CallID CallManagerId,nodeId,PROCESS TS.


    why is the comma appearing before the first field?

    Re: Navigation in List Box


    I do have AddItem to populate the ListBox,as per my code above.
    Also, This is what I am trying to figure:
    When I bring up the form, the list box is populated automatically, which I am confused, since the rowsource is set based on combobox.
    When I change the category, the list box gets populated but fails when I try to add items.

    Hi All,



    I tried posting this before, but it failed because I did not tag it
    I am using a combobox above a list box. The combobox has a list of 5 categories. Each category has few fields associated to it.
    The category list and the fields associated with each category are populated in a worksheet with a named range.


    I have two list boxes.The first list box rowsource is based on the selection of the combobox category.

    When I bring up the form, the list box is populated automatically, which I am confused, since the rowsource is set based on combobox.
    When I change the category, the list box gets populated but fails when I try to add items.


    I have a ADD and a Remove button to add or remove items between two list boxes.
    When I try to add items to the second list box, it fails at the RemoveItem i line.
    [
    .....
    Me.lstBox1.RemoveItem i
    ...
    ]




    I guess, the list box should be cleared,but I have no idea.


    Thanks,

    Re: Transfer from ListBox to TextBox


    On my parent form, frmReport I have this textbox,txtboxFields. If I run your code on the Child form's submit button,then how does it get transferred to the txtbox of the Parent form?

    Code
    Private Sub cmdSubmit_Click()
    Dim lItem As Long
    Dim allItems As String
      
    For lItem = 0 To lstBox2.ListCount - 1
        allItems = allItems & lstBox2.List(lItem)
    Next lItem
    
    
    End Sub