Skip to main content

Posts

Beauty of Nalsarovar

Beauty of Nalsarovar

Monuments of india,Delhi

monuments of india,Delhi

Anjuna and vagator beaches

create an Index sheet for all the worksheets within the workbook,Creating a Table of Contents

create an Index sheet for all the worksheets within the workbook In this example there is worksheet named 'HOME' where you create a list of worksheets.  Sub ListSheets() ' Description: This procedure creates worksheet List ' and corresponding GoTo hyperlinks. '-- Const cstrProcedure = "ListSheets" On Error GoTo HandleError Dim wks As Worksheet Dim strSheetName As String Dim i As Integer, j As Integer, n As Integer Application.ScreenUpdating = False With ThisWorkbook n = .Worksheets.Count ' Customize Start Reference Set c = .Worksheets("Home").Range("B6") ' Start List From HOME!B6 c.CurrentRegion.Offset(1, 0).ClearContents i = 0: j = 0 For Each wks In .Worksheets i = i + 1 ''' If Sheet Name <> predefined sheet names thenh update List by sheet name If (wks.Name <> "HOME&quo

Paste in Sheet selected from a Userform ComboBox

Paste in Sheet selected from a Userform ComboBox Sub CopyTest() '---------- 'Sheets("?Sheet1")Select ' <<< Syntax!! (apostroph) 'Range("B:E").Select 'Selection.Copy 'Sheets(cboPasteInSheet.Text).Select '-- ' What do you want to do here? ' what are E13 and HA13 ?? 'For i = E13 To HA13 Step 4 'If ActiveCell.Row = Empty Then 'ActiveCell.EntireRow.Insert 'End If 'Next i '------------ ' Syntax how to Copy Excel Range to another position: With Worksheets("Sheet1") ' Copy complete Columns .Range("B:E").Copy Destination:=.Range("H:H") ' Copy Range (H2=destination Top-Left Cell) .Range("B2:E20").Copy Destination:=.Range("H2") End With End Sub

Function To Returns Max ID As Identity With Table Name and Field Name As Parameter in SQL

Function To Returns Max ID As Identity With Table Name and Field Name As Parameter in SQL CREATE PROCEDURE [dbo].[aMaxId] @TableName nvarchar(100), @FieldName nvarchar(100) AS DECLARE @sql nvarchar(4000) SELECT @sql = ' SELECT IsNull(Max('+@FieldName+'),0)+1 as Maxi' + ' FROM dbo.'+@TableName EXEC sp_executesql @sql